Move result projection to protocol edge
This commit is contained in:
parent
37791c3fc0
commit
d6d3d38375
9 changed files with 150 additions and 164 deletions
|
|
@ -1,7 +1,6 @@
|
|||
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 epiphany_core::EpiphanyReorientAcceptanceFinding;
|
||||
use epiphany_core::EpiphanyReorientFindingInterpretation as CoreEpiphanyReorientFinding;
|
||||
use epiphany_core::EpiphanyRoleAcceptanceFinding;
|
||||
|
|
@ -42,30 +41,6 @@ pub fn parse_core_role_finding_state_patch(
|
|||
.ok_or_else(|| "completed role finding did not include a reviewable statePatch".to_string())
|
||||
}
|
||||
|
||||
pub fn protocol_patch_from_core(
|
||||
patch: EpiphanyRoleStatePatchDocument,
|
||||
) -> ThreadEpiphanyUpdatePatch {
|
||||
ThreadEpiphanyUpdatePatch {
|
||||
objective: patch.objective,
|
||||
active_subgoal_id: patch.active_subgoal_id,
|
||||
subgoals: patch.subgoals,
|
||||
invariants: patch.invariants,
|
||||
graphs: patch.graphs,
|
||||
graph_frontier: patch.graph_frontier,
|
||||
graph_checkpoint: patch.graph_checkpoint,
|
||||
scratch: patch.scratch,
|
||||
investigation_checkpoint: patch.investigation_checkpoint,
|
||||
job_bindings: patch.job_bindings,
|
||||
acceptance_receipts: patch.acceptance_receipts,
|
||||
runtime_links: patch.runtime_links,
|
||||
observations: patch.observations,
|
||||
evidence: patch.evidence,
|
||||
churn: patch.churn,
|
||||
mode: patch.mode,
|
||||
planning: patch.planning,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn state_update_from_core_patch(
|
||||
expected_revision: Option<u64>,
|
||||
patch: EpiphanyRoleStatePatchDocument,
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ use codex_app_server_protocol::ThreadEpiphanyPressureStatus;
|
|||
use codex_app_server_protocol::ThreadEpiphanyReorientAction;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientCheckpointStatus;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientDecision;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientReason;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientResultStatus;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientSource;
|
||||
|
|
@ -41,7 +42,11 @@ 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;
|
||||
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::ThreadEpiphanyUpdatePatch;
|
||||
use codex_app_server_protocol::ThreadEpiphanyViewLens;
|
||||
|
|
@ -57,7 +62,12 @@ use epiphany_core::EpiphanyPressure;
|
|||
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::EpiphanyViewLens;
|
||||
|
|
@ -180,6 +190,103 @@ pub fn protocol_update_patch_to_core(
|
|||
}
|
||||
}
|
||||
|
||||
pub fn protocol_patch_from_core(
|
||||
patch: EpiphanyRoleStatePatchDocument,
|
||||
) -> ThreadEpiphanyUpdatePatch {
|
||||
ThreadEpiphanyUpdatePatch {
|
||||
objective: patch.objective,
|
||||
active_subgoal_id: patch.active_subgoal_id,
|
||||
subgoals: patch.subgoals,
|
||||
invariants: patch.invariants,
|
||||
graphs: patch.graphs,
|
||||
graph_frontier: patch.graph_frontier,
|
||||
graph_checkpoint: patch.graph_checkpoint,
|
||||
scratch: patch.scratch,
|
||||
investigation_checkpoint: patch.investigation_checkpoint,
|
||||
job_bindings: patch.job_bindings,
|
||||
acceptance_receipts: patch.acceptance_receipts,
|
||||
runtime_links: patch.runtime_links,
|
||||
observations: patch.observations,
|
||||
evidence: patch.evidence,
|
||||
churn: patch.churn,
|
||||
mode: patch.mode,
|
||||
planning: patch.planning,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_role_id_to_core(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleResultRoleId {
|
||||
match role_id {
|
||||
ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation,
|
||||
ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination,
|
||||
ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling,
|
||||
ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification,
|
||||
ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_role_id_from_core(role_id: EpiphanyRoleResultRoleId) -> ThreadEpiphanyRoleId {
|
||||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
|
||||
EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
|
||||
EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
|
||||
EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification,
|
||||
EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_reorient_finding(
|
||||
finding: EpiphanyReorientFindingInterpretation,
|
||||
) -> ThreadEpiphanyReorientFinding {
|
||||
ThreadEpiphanyReorientFinding {
|
||||
mode: finding.mode,
|
||||
summary: finding.summary,
|
||||
next_safe_move: finding.next_safe_move,
|
||||
checkpoint_still_valid: finding.checkpoint_still_valid,
|
||||
files_inspected: finding.files_inspected,
|
||||
frontier_node_ids: finding.frontier_node_ids,
|
||||
evidence_ids: finding.evidence_ids,
|
||||
artifact_refs: finding.artifact_refs,
|
||||
runtime_result_id: finding.runtime_result_id,
|
||||
runtime_job_id: finding.runtime_job_id,
|
||||
job_error: finding.job_error,
|
||||
item_error: finding.item_error,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_role_finding(
|
||||
role_id: ThreadEpiphanyRoleId,
|
||||
finding: EpiphanyRoleFindingInterpretation,
|
||||
) -> ThreadEpiphanyRoleFinding {
|
||||
let state_patch = finding.state_patch.map(protocol_patch_from_core);
|
||||
ThreadEpiphanyRoleFinding {
|
||||
role_id,
|
||||
verdict: finding.verdict,
|
||||
summary: finding.summary,
|
||||
next_safe_move: finding.next_safe_move,
|
||||
checkpoint_summary: finding.checkpoint_summary,
|
||||
scratch_summary: finding.scratch_summary,
|
||||
files_inspected: finding.files_inspected,
|
||||
frontier_node_ids: finding.frontier_node_ids,
|
||||
evidence_ids: finding.evidence_ids,
|
||||
artifact_refs: finding.artifact_refs,
|
||||
runtime_result_id: finding.runtime_result_id,
|
||||
runtime_job_id: finding.runtime_job_id,
|
||||
open_questions: finding.open_questions,
|
||||
evidence_gaps: finding.evidence_gaps,
|
||||
risks: finding.risks,
|
||||
state_patch,
|
||||
self_patch: finding.self_patch.map(|patch| {
|
||||
serde_json::to_value(patch)
|
||||
.expect("AgentSelfPatch is a serializable protocol projection")
|
||||
}),
|
||||
self_persistence: finding
|
||||
.self_persistence
|
||||
.map(protocol_self_persistence_review),
|
||||
job_error: finding.job_error,
|
||||
item_error: finding.item_error,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_freshness_response_from_surface(
|
||||
surface: EpiphanyFreshnessSurface,
|
||||
) -> ThreadEpiphanyFreshnessResponse {
|
||||
|
|
@ -581,3 +688,24 @@ fn protocol_reorient_reason(reason: EpiphanyReorientReason) -> ThreadEpiphanyReo
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn protocol_self_persistence_review(
|
||||
review: EpiphanyRoleSelfPersistenceReview,
|
||||
) -> ThreadEpiphanyRoleSelfPersistenceReview {
|
||||
ThreadEpiphanyRoleSelfPersistenceReview {
|
||||
status: match review.status {
|
||||
EpiphanyRoleSelfPersistenceStatus::Missing => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Missing
|
||||
}
|
||||
EpiphanyRoleSelfPersistenceStatus::Accepted => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Accepted
|
||||
}
|
||||
EpiphanyRoleSelfPersistenceStatus::Rejected => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Rejected
|
||||
}
|
||||
},
|
||||
target_agent_id: review.target_agent_id,
|
||||
target_path: review.target_path,
|
||||
reasons: review.reasons,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
use codex_app_server_protocol::ThreadEpiphanyReorientFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleFinding;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleId;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceReview;
|
||||
use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceStatus;
|
||||
use codex_app_server_protocol::ThreadEpiphanyUpdatePatch;
|
||||
use epiphany_core::EpiphanyCoordinatorRoleResultStatus as CoreEpiphanyCoordinatorRoleResultStatus;
|
||||
use epiphany_core::EpiphanyCrrcResultStatus as CoreEpiphanyCrrcResultStatus;
|
||||
use epiphany_core::EpiphanyReorientFindingInterpretation;
|
||||
|
|
@ -11,123 +5,6 @@ use epiphany_core::EpiphanyRoleFindingInterpretation;
|
|||
use epiphany_core::EpiphanyRoleResultRoleId;
|
||||
use epiphany_core::EpiphanyRoleSelfPersistenceReview as CoreEpiphanyRoleSelfPersistenceReview;
|
||||
use epiphany_core::EpiphanyRoleSelfPersistenceStatus as CoreEpiphanyRoleSelfPersistenceStatus;
|
||||
use epiphany_core::EpiphanyRoleStatePatchDocument;
|
||||
|
||||
pub fn map_protocol_reorient_finding(
|
||||
finding: EpiphanyReorientFindingInterpretation,
|
||||
) -> ThreadEpiphanyReorientFinding {
|
||||
ThreadEpiphanyReorientFinding {
|
||||
mode: finding.mode,
|
||||
summary: finding.summary,
|
||||
next_safe_move: finding.next_safe_move,
|
||||
checkpoint_still_valid: finding.checkpoint_still_valid,
|
||||
files_inspected: finding.files_inspected,
|
||||
frontier_node_ids: finding.frontier_node_ids,
|
||||
evidence_ids: finding.evidence_ids,
|
||||
artifact_refs: finding.artifact_refs,
|
||||
runtime_result_id: finding.runtime_result_id,
|
||||
runtime_job_id: finding.runtime_job_id,
|
||||
job_error: finding.job_error,
|
||||
item_error: finding.item_error,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_protocol_role_finding(
|
||||
role_id: ThreadEpiphanyRoleId,
|
||||
finding: EpiphanyRoleFindingInterpretation,
|
||||
) -> ThreadEpiphanyRoleFinding {
|
||||
let state_patch = finding.state_patch.map(map_protocol_update_patch);
|
||||
ThreadEpiphanyRoleFinding {
|
||||
role_id,
|
||||
verdict: finding.verdict,
|
||||
summary: finding.summary,
|
||||
next_safe_move: finding.next_safe_move,
|
||||
checkpoint_summary: finding.checkpoint_summary,
|
||||
scratch_summary: finding.scratch_summary,
|
||||
files_inspected: finding.files_inspected,
|
||||
frontier_node_ids: finding.frontier_node_ids,
|
||||
evidence_ids: finding.evidence_ids,
|
||||
artifact_refs: finding.artifact_refs,
|
||||
runtime_result_id: finding.runtime_result_id,
|
||||
runtime_job_id: finding.runtime_job_id,
|
||||
open_questions: finding.open_questions,
|
||||
evidence_gaps: finding.evidence_gaps,
|
||||
risks: finding.risks,
|
||||
state_patch,
|
||||
self_patch: finding.self_patch.map(|patch| {
|
||||
serde_json::to_value(patch)
|
||||
.expect("AgentSelfPatch is a serializable protocol projection")
|
||||
}),
|
||||
self_persistence: finding
|
||||
.self_persistence
|
||||
.map(map_protocol_role_self_persistence_review),
|
||||
job_error: finding.job_error,
|
||||
item_error: finding.item_error,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_protocol_update_patch(patch: EpiphanyRoleStatePatchDocument) -> ThreadEpiphanyUpdatePatch {
|
||||
ThreadEpiphanyUpdatePatch {
|
||||
objective: patch.objective,
|
||||
active_subgoal_id: patch.active_subgoal_id,
|
||||
subgoals: patch.subgoals,
|
||||
invariants: patch.invariants,
|
||||
graphs: patch.graphs,
|
||||
graph_frontier: patch.graph_frontier,
|
||||
graph_checkpoint: patch.graph_checkpoint,
|
||||
scratch: patch.scratch,
|
||||
investigation_checkpoint: patch.investigation_checkpoint,
|
||||
job_bindings: patch.job_bindings,
|
||||
acceptance_receipts: patch.acceptance_receipts,
|
||||
runtime_links: patch.runtime_links,
|
||||
observations: patch.observations,
|
||||
evidence: patch.evidence,
|
||||
churn: patch.churn,
|
||||
mode: patch.mode,
|
||||
planning: patch.planning,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_core_role_result_role_id(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleResultRoleId {
|
||||
match role_id {
|
||||
ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation,
|
||||
ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination,
|
||||
ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling,
|
||||
ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification,
|
||||
ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_protocol_role_result_role_id(role_id: EpiphanyRoleResultRoleId) -> ThreadEpiphanyRoleId {
|
||||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
|
||||
EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
|
||||
EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
|
||||
EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification,
|
||||
EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_protocol_role_self_persistence_review(
|
||||
review: CoreEpiphanyRoleSelfPersistenceReview,
|
||||
) -> ThreadEpiphanyRoleSelfPersistenceReview {
|
||||
ThreadEpiphanyRoleSelfPersistenceReview {
|
||||
status: match review.status {
|
||||
CoreEpiphanyRoleSelfPersistenceStatus::Missing => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Missing
|
||||
}
|
||||
CoreEpiphanyRoleSelfPersistenceStatus::Accepted => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Accepted
|
||||
}
|
||||
CoreEpiphanyRoleSelfPersistenceStatus::Rejected => {
|
||||
ThreadEpiphanyRoleSelfPersistenceStatus::Rejected
|
||||
}
|
||||
},
|
||||
target_agent_id: review.target_agent_id,
|
||||
target_path: review.target_path,
|
||||
reasons: review.reasons,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn render_core_role_result_note(
|
||||
role_id: EpiphanyRoleResultRoleId,
|
||||
|
|
|
|||
|
|
@ -37,14 +37,15 @@ use crate::pressure::derive_epiphany_pressure;
|
|||
use crate::pressure::map_epiphany_pressure;
|
||||
use crate::protocol_edge::protocol_job_from_surface;
|
||||
use crate::protocol_edge::protocol_reorient_decision;
|
||||
use crate::protocol_edge::protocol_reorient_finding;
|
||||
use crate::protocol_edge::protocol_reorient_result_status;
|
||||
use crate::protocol_edge::protocol_reorient_state_status;
|
||||
use crate::protocol_edge::protocol_role_finding;
|
||||
use crate::protocol_edge::protocol_role_id_from_core;
|
||||
use crate::protocol_edge::protocol_role_result_status;
|
||||
use crate::reorient::EpiphanyFreshnessWatcherSnapshot;
|
||||
use crate::reorient::derive_epiphany_freshness_view;
|
||||
use crate::reorient::derive_epiphany_reorient;
|
||||
use crate::results::map_protocol_reorient_finding;
|
||||
use crate::results::map_protocol_role_result_role_id;
|
||||
use crate::runtime_results::load_core_epiphany_reorient_result_snapshot;
|
||||
use crate::runtime_results::load_core_epiphany_role_result_snapshot;
|
||||
use crate::scene::map_core_epiphany_scene_action;
|
||||
|
|
@ -224,7 +225,7 @@ pub async fn map_epiphany_view_response(
|
|||
let reorient_finding = reorient_result
|
||||
.finding
|
||||
.clone()
|
||||
.map(map_protocol_reorient_finding);
|
||||
.map(protocol_reorient_finding);
|
||||
let reorient_result_note = reorient_result.note.clone();
|
||||
let checkpoint_present = state
|
||||
.and_then(|state| state.investigation_checkpoint.as_ref())
|
||||
|
|
@ -450,7 +451,7 @@ pub async fn map_epiphany_role_result_response(
|
|||
state,
|
||||
runtime_store_path,
|
||||
} = input;
|
||||
let protocol_role_id = map_protocol_role_result_role_id(role_id);
|
||||
let protocol_role_id = protocol_role_id_from_core(role_id);
|
||||
let protocol_source = map_protocol_roles_source(source);
|
||||
let Some(state) = state else {
|
||||
return ThreadEpiphanyRoleResultResponse {
|
||||
|
|
@ -486,7 +487,7 @@ pub async fn map_epiphany_role_result_response(
|
|||
job,
|
||||
finding: result
|
||||
.finding
|
||||
.map(|finding| crate::results::map_protocol_role_finding(protocol_role_id, finding)),
|
||||
.map(|finding| protocol_role_finding(protocol_role_id, finding)),
|
||||
note: result.note,
|
||||
}
|
||||
}
|
||||
|
|
@ -540,7 +541,7 @@ pub async fn map_epiphany_reorient_result_response(
|
|||
binding_id,
|
||||
status: protocol_reorient_result_status(result.status),
|
||||
job,
|
||||
finding: result.finding.map(map_protocol_reorient_finding),
|
||||
finding: result.finding.map(protocol_reorient_finding),
|
||||
note: result.note,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ remembers doctrine; the branch remembers the blade.
|
|||
- Runtime result loading is typed-only now. Role/reorient result status projection moved out of `runtime_results` and duplicate coordinator helpers into `protocol_edge`, so view and coordinator response builders share one Codex JSON-RPC status mapper.
|
||||
- Pressure projection is centralized too. `pressure.rs` derives typed `EpiphanyPressure`, coordinator consumes typed pressure signals, and `protocol_edge` owns the `ThreadEpiphanyPressure*` DTO mapping.
|
||||
- Reorientation derivation is typed-only too. `reorient.rs` no longer imports app-server protocol DTOs and no longer exposes the unused freshness DTO tuple; view/coordinator response builders call `protocol_edge` for reorient state/decision projection.
|
||||
- Result projection moved to the edge. `results.rs` now renders typed result notes only; `protocol_edge` owns role-id request conversion plus role/reorient finding and state-patch projection for Codex JSON-RPC responses.
|
||||
- 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.
|
||||
- Codex account auth route handling remains in vendored Codex but now lives in `codex_message_processor/auth_routes.rs`: API-key login, ChatGPT browser/device-code/external-token login, logout, auth status, account, rate limits, and add-credits nudge handling. This preserves Codex ownership of subscription auth while cutting the root processor to about 8,094 lines.
|
||||
- One-off command execution and command stream write/resize/terminate route handling now live in `codex_message_processor/command_routes.rs`; `CommandExecManager` remains the lifecycle owner, while the root processor is about 7,800 lines.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -414,6 +414,10 @@ current_status:
|
|||
`reorient.rs` no longer imports Codex app-server protocol DTOs, no longer
|
||||
exposes the unused freshness DTO tuple, and view/coordinator response
|
||||
builders use `protocol_edge` for reorient state/decision projection.
|
||||
Result finding, role-id, and patch projection are now edge-owned too:
|
||||
`results.rs` renders typed result notes only, while `protocol_edge` owns
|
||||
role-id request conversion plus role/reorient finding and state-patch
|
||||
projection for Codex JSON-RPC responses.
|
||||
The bridge still depends on vendored Codex for app-server protocol DTOs and
|
||||
absolute path validation, so the purification is not done.
|
||||
next_action: Continue Codex starvation and CultNet liberation by cutting bridge-internal response/projection authority. Prioritize the next coordinator/view seam that still composes policy-shaped facts instead of merely loading host facts and projecting core surfaces; keep MCP/OpenAI JSON only at their true protocol/text edges. Do not add compatibility adapters unless they protect a named ownership invariant.
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ use epiphany_codex_bridge::launch::build_epiphany_job_launch_request;
|
|||
use epiphany_codex_bridge::launch::epiphany_role_binding_id;
|
||||
use epiphany_codex_bridge::mutation::epiphany_state_updated_notification;
|
||||
use epiphany_codex_bridge::mutation::map_protocol_state_updated_fields;
|
||||
use epiphany_codex_bridge::mutation::protocol_patch_from_core;
|
||||
use epiphany_codex_bridge::mutation_service::EpiphanyThreadPromoteApplied;
|
||||
use epiphany_codex_bridge::mutation_service::apply_thread_epiphany_promote;
|
||||
use epiphany_codex_bridge::mutation_service::apply_thread_epiphany_reorient_accept;
|
||||
|
|
@ -22,14 +21,15 @@ use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_job;
|
|||
use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_reorient;
|
||||
use epiphany_codex_bridge::mutation_service::launch_thread_epiphany_role;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_job_from_surface;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_patch_from_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_reorient_decision;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_reorient_finding;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_reorient_source;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_reorient_state_status;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_role_finding;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_role_id_to_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_update_patch_to_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_worker_launch_document_to_core;
|
||||
use epiphany_codex_bridge::results::map_core_role_result_role_id;
|
||||
use epiphany_codex_bridge::results::map_protocol_reorient_finding;
|
||||
use epiphany_codex_bridge::results::map_protocol_role_finding;
|
||||
use epiphany_codex_bridge::retrieve::epiphany_retrieval_state_for_paths;
|
||||
use epiphany_codex_bridge::retrieve::index_epiphany_retrieval_for_paths;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -104,7 +104,7 @@ impl CodexMessageProcessor {
|
|||
expected_revision,
|
||||
max_runtime_seconds,
|
||||
} = params;
|
||||
let core_role_id = map_core_role_result_role_id(role_id);
|
||||
let core_role_id = protocol_role_id_to_core(role_id);
|
||||
|
||||
let (thread_uuid, loaded_thread) =
|
||||
match self.load_epiphany_thread(&request_id, &thread_id).await {
|
||||
|
|
@ -176,7 +176,7 @@ impl CodexMessageProcessor {
|
|||
expected_revision,
|
||||
binding_id,
|
||||
} = params;
|
||||
let core_role_id = map_core_role_result_role_id(role_id);
|
||||
let core_role_id = protocol_role_id_to_core(role_id);
|
||||
|
||||
let default_binding_id = match epiphany_role_binding_id(core_role_id) {
|
||||
Ok(binding_id) => binding_id,
|
||||
|
|
@ -232,7 +232,7 @@ impl CodexMessageProcessor {
|
|||
accepted_observation_id: applied.accepted_observation_id,
|
||||
accepted_evidence_id: applied.accepted_evidence_id,
|
||||
applied_patch: protocol_patch_from_core(applied.applied_patch),
|
||||
finding: map_protocol_role_finding(role_id, applied.finding),
|
||||
finding: protocol_role_finding(role_id, applied.finding),
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
@ -404,7 +404,7 @@ impl CodexMessageProcessor {
|
|||
accepted_receipt_id: applied.accepted_receipt_id,
|
||||
accepted_observation_id: applied.accepted_observation_id,
|
||||
accepted_evidence_id: applied.accepted_evidence_id,
|
||||
finding: map_protocol_reorient_finding(applied.finding),
|
||||
finding: protocol_reorient_finding(applied.finding),
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ use epiphany_codex_bridge::protocol_edge::protocol_context_params_to_core;
|
|||
use epiphany_codex_bridge::protocol_edge::protocol_distill_params_to_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_freshness_response_from_surface;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_graph_query_to_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_role_id_to_core;
|
||||
use epiphany_codex_bridge::protocol_edge::protocol_view_lenses_to_core;
|
||||
use epiphany_codex_bridge::results::map_core_role_result_role_id;
|
||||
use epiphany_codex_bridge::retrieve::epiphany_retrieval_state_for_paths;
|
||||
use epiphany_codex_bridge::retrieve::map_epiphany_retrieve_response;
|
||||
use epiphany_codex_bridge::retrieve::normalize_thread_epiphany_retrieve_query;
|
||||
|
|
@ -159,7 +159,7 @@ impl CodexMessageProcessor {
|
|||
role_id,
|
||||
binding_id,
|
||||
} = params;
|
||||
let core_role_id = map_core_role_result_role_id(role_id);
|
||||
let core_role_id = protocol_role_id_to_core(role_id);
|
||||
|
||||
let binding_id = match binding_id {
|
||||
Some(binding_id) => binding_id,
|
||||
|
|
|
|||
Reference in a new issue