Move patch request mapping to app server
This commit is contained in:
parent
63528fbf10
commit
6086c8a7c3
5 changed files with 31 additions and 27 deletions
|
|
@ -42,30 +42,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 core_state_patch_from_protocol(
|
||||
patch: &ThreadEpiphanyUpdatePatch,
|
||||
) -> EpiphanyRoleStatePatchDocument {
|
||||
EpiphanyRoleStatePatchDocument {
|
||||
objective: patch.objective.clone(),
|
||||
active_subgoal_id: patch.active_subgoal_id.clone(),
|
||||
subgoals: patch.subgoals.clone(),
|
||||
invariants: patch.invariants.clone(),
|
||||
graphs: patch.graphs.clone(),
|
||||
graph_frontier: patch.graph_frontier.clone(),
|
||||
graph_checkpoint: patch.graph_checkpoint.clone(),
|
||||
scratch: patch.scratch.clone(),
|
||||
investigation_checkpoint: patch.investigation_checkpoint.clone(),
|
||||
job_bindings: patch.job_bindings.clone(),
|
||||
acceptance_receipts: patch.acceptance_receipts.clone(),
|
||||
runtime_links: patch.runtime_links.clone(),
|
||||
observations: patch.observations.clone(),
|
||||
evidence: patch.evidence.clone(),
|
||||
churn: patch.churn.clone(),
|
||||
mode: patch.mode.clone(),
|
||||
planning: patch.planning.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn protocol_patch_from_core(
|
||||
patch: EpiphanyRoleStatePatchDocument,
|
||||
) -> ThreadEpiphanyUpdatePatch {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ remembers doctrine; the branch remembers the blade.
|
|||
- Context and graph-query request conversion now belongs to the app-server JSON-RPC wall. `epiphany-codex-bridge::context` receives core `EpiphanyContextParams` / `EpiphanyGraphQuery` and only projects core context/query views back into legacy response DTOs.
|
||||
- Distill request conversion also belongs to the app-server wall. The bridge distill response builder consumes core `EpiphanyDistillInput`; `ThreadEpiphanyDistillParams` should not re-enter bridge policy.
|
||||
- Generic job-launch document conversion also belongs to app-server. `ThreadEpiphanyWorkerLaunchDocument` is converted to core `EpiphanyWorkerLaunchDocument` before bridge launch/mutation law runs.
|
||||
- Generic update/promote patch conversion also belongs to app-server. `ThreadEpiphanyUpdatePatch` is converted to core `EpiphanyRoleStatePatchDocument` before mutation service calls; bridge mutation keeps legacy response patch projection only.
|
||||
- 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.
|
|
@ -389,6 +389,9 @@ current_status:
|
|||
construction receives core `EpiphanyDistillInput`. Generic job launch
|
||||
document conversion moved to app-server too; bridge launch receives core
|
||||
`EpiphanyWorkerLaunchDocument` instead of protocol worker launch cargo.
|
||||
Generic update/promote patch conversion moved to app-server as well; bridge
|
||||
mutation receives core `EpiphanyRoleStatePatchDocument` and keeps only
|
||||
legacy response patch projection.
|
||||
Reorient worker launch-request/document
|
||||
composition also moved behind a typed core seam
|
||||
(`EpiphanyReorientLaunchRequestInput` -> `EpiphanyJobLaunchRequest`);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ use epiphany_codex_bridge::invalidation::epiphany_freshness_watcher_snapshot;
|
|||
use epiphany_codex_bridge::launch::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
|
||||
use epiphany_codex_bridge::launch::build_epiphany_job_launch_request;
|
||||
use epiphany_codex_bridge::launch::epiphany_role_binding_id;
|
||||
use epiphany_codex_bridge::mutation::core_state_patch_from_protocol;
|
||||
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;
|
||||
|
|
@ -39,6 +38,7 @@ 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 epiphany_core::EpiphanyReorientWorkerLaunchDocument;
|
||||
use epiphany_core::EpiphanyRoleStatePatchDocument;
|
||||
use epiphany_core::EpiphanyRoleWorkerLaunchDocument;
|
||||
use epiphany_core::EpiphanyWorkerLaunchDocument;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -482,7 +482,7 @@ impl CodexMessageProcessor {
|
|||
};
|
||||
|
||||
let host = EpiphanyCodexThreadHost::new(thread.as_ref());
|
||||
let core_patch = core_state_patch_from_protocol(&patch);
|
||||
let core_patch = thread_epiphany_update_patch_to_core(&patch);
|
||||
let applied = match apply_thread_epiphany_promote(
|
||||
&host,
|
||||
expected_revision,
|
||||
|
|
@ -562,7 +562,7 @@ impl CodexMessageProcessor {
|
|||
};
|
||||
|
||||
let host = EpiphanyCodexThreadHost::new(thread.as_ref());
|
||||
let core_patch = core_state_patch_from_protocol(&patch);
|
||||
let core_patch = thread_epiphany_update_patch_to_core(&patch);
|
||||
let applied = match apply_thread_epiphany_update(&host, expected_revision, core_patch).await
|
||||
{
|
||||
Ok(applied) => applied,
|
||||
|
|
@ -811,6 +811,30 @@ fn thread_epiphany_worker_launch_document_to_core(
|
|||
}
|
||||
}
|
||||
|
||||
fn thread_epiphany_update_patch_to_core(
|
||||
patch: &ThreadEpiphanyUpdatePatch,
|
||||
) -> EpiphanyRoleStatePatchDocument {
|
||||
EpiphanyRoleStatePatchDocument {
|
||||
objective: patch.objective.clone(),
|
||||
active_subgoal_id: patch.active_subgoal_id.clone(),
|
||||
subgoals: patch.subgoals.clone(),
|
||||
invariants: patch.invariants.clone(),
|
||||
graphs: patch.graphs.clone(),
|
||||
graph_frontier: patch.graph_frontier.clone(),
|
||||
graph_checkpoint: patch.graph_checkpoint.clone(),
|
||||
scratch: patch.scratch.clone(),
|
||||
investigation_checkpoint: patch.investigation_checkpoint.clone(),
|
||||
job_bindings: patch.job_bindings.clone(),
|
||||
acceptance_receipts: patch.acceptance_receipts.clone(),
|
||||
runtime_links: patch.runtime_links.clone(),
|
||||
observations: patch.observations.clone(),
|
||||
evidence: patch.evidence.clone(),
|
||||
churn: patch.churn.clone(),
|
||||
mode: patch.mode.clone(),
|
||||
planning: patch.planning.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
fn thread_epiphany_role_worker_launch_document_to_core(
|
||||
document: ThreadEpiphanyRoleWorkerLaunchDocument,
|
||||
) -> EpiphanyRoleWorkerLaunchDocument {
|
||||
|
|
|
|||
Reference in a new issue