Keep coordinator note core-shaped

This commit is contained in:
Meta Vens 2026-05-20 07:46:37 +01:00
commit 45ad254bab
5 changed files with 22 additions and 23 deletions

View file

@ -404,12 +404,12 @@ pub async fn derive_epiphany_coordinator_status(
reorient_finding_accepted,
);
let note = render_epiphany_coordinator_note(
map_protocol_crrc_action(recommendation.action),
map_protocol_pressure_level(pressure.level),
map_protocol_coordinator_role_result_status(modeling_result_status),
map_protocol_coordinator_role_result_status(verification_result_status),
reorient_result_status,
map_protocol_coordinator_action(decision.action),
recommendation.action,
pressure.level,
modeling_result_status,
verification_result_status,
source_signals.reorient_result_status,
decision.action,
);
EpiphanyCoordinatorStatus {

View file

@ -1,11 +1,15 @@
use std::path::Path;
use std::sync::OnceLock;
use codex_app_server_protocol::ThreadEpiphanyPressureLevel;
use codex_app_server_protocol::ThreadEpiphanyReorientWorkerLaunchDocument;
use codex_app_server_protocol::ThreadEpiphanyRoleWorkerLaunchDocument;
use codex_app_server_protocol::ThreadEpiphanyWorkerLaunchDocument;
use epiphany_core::EpiphanyCoordinatorAction as CoreEpiphanyCoordinatorAction;
use epiphany_core::EpiphanyCoordinatorRoleResultStatus as CoreEpiphanyCoordinatorRoleResultStatus;
use epiphany_core::EpiphanyCrrcAction as CoreEpiphanyCrrcAction;
use epiphany_core::EpiphanyCrrcResultStatus as CoreEpiphanyCrrcResultStatus;
use epiphany_core::EpiphanyJobLaunchRequest;
use epiphany_core::EpiphanyPressureLevel as CoreEpiphanyPressureLevel;
use epiphany_core::EpiphanyReorientAction as CoreEpiphanyReorientAction;
use epiphany_core::EpiphanyReorientDecision as CoreEpiphanyReorientDecision;
use epiphany_core::EpiphanyReorientFreshnessStatus as CoreEpiphanyReorientFreshnessStatus;
@ -679,12 +683,12 @@ fn map_core_reorient_worker_launch_document(
}
pub fn render_epiphany_coordinator_note(
crrc_action: codex_app_server_protocol::ThreadEpiphanyCrrcAction,
pressure_level: ThreadEpiphanyPressureLevel,
modeling_result_status: codex_app_server_protocol::ThreadEpiphanyRoleResultStatus,
verification_result_status: codex_app_server_protocol::ThreadEpiphanyRoleResultStatus,
reorient_result_status: codex_app_server_protocol::ThreadEpiphanyReorientResultStatus,
coordinator_action: codex_app_server_protocol::ThreadEpiphanyCoordinatorAction,
crrc_action: CoreEpiphanyCrrcAction,
pressure_level: CoreEpiphanyPressureLevel,
modeling_result_status: CoreEpiphanyCoordinatorRoleResultStatus,
verification_result_status: CoreEpiphanyCoordinatorRoleResultStatus,
reorient_result_status: CoreEpiphanyCrrcResultStatus,
coordinator_action: CoreEpiphanyCoordinatorAction,
) -> String {
let template = epiphany_agent_prompt_with_memory(
&epiphany_specialist_prompt_config()
@ -790,13 +794,3 @@ fn reorient_freshness_status_label(status: CoreEpiphanyReorientFreshnessStatus)
CoreEpiphanyReorientFreshnessStatus::Changed => "changed",
}
}
pub fn pressure_level_label(level: ThreadEpiphanyPressureLevel) -> &'static str {
match level {
ThreadEpiphanyPressureLevel::Unknown => "unknown",
ThreadEpiphanyPressureLevel::Low => "low",
ThreadEpiphanyPressureLevel::Elevated => "elevated",
ThreadEpiphanyPressureLevel::High => "high",
ThreadEpiphanyPressureLevel::Critical => "critical",
}
}

View file

@ -65,6 +65,7 @@ remembers doctrine; the branch remembers the blade.
- Role launch, role accept, and role-result runtime lookup now use core `EpiphanyRoleResultRoleId` inside the bridge. App-server maps `ThreadEpiphanyRoleId` at the JSON-RPC boundary and keeps it only for legacy request/response shape.
- Reorient launch service results now use typed `EpiphanySurfaceSource`; app-server projects it into `ThreadEpiphanyReorientSource` only for the legacy launch response.
- Generic job launch now converts protocol `ThreadEpiphanyWorkerLaunchDocument` cargo at the app-server edge before building the core `EpiphanyJobLaunchRequest`; the bridge launch builder takes a typed `EpiphanyWorkerLaunchDocument`.
- Coordinator note rendering now consumes core CRRC/coordinator actions, pressure, and role/reorient result statuses. `ThreadEpiphany*` status/action DTOs are no longer the native shape for that prompt/text policy helper.
- 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.

View file

@ -349,6 +349,10 @@ current_status:
to `ThreadEpiphanyReorientSource` only for the legacy response. Generic job
launch now converts protocol `ThreadEpiphanyWorkerLaunchDocument` cargo at
the app-server edge before building the core `EpiphanyJobLaunchRequest`.
Coordinator note rendering now consumes core CRRC/coordinator actions,
pressure, and role/reorient result statuses instead of protocol
`ThreadEpiphany*` action/status DTOs, so prompt/text policy no longer
treats JSON-RPC enums as its native fact shape.
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 `ThreadEpiphany*` authority. Prioritize role-result/reorient-result DTO coupling next: derive typed CultNet surfaces first, push JSON-RPC projection into app-server, and keep MCP/OpenAI JSON only at their true protocol/text edges. Do not add compatibility adapters unless they protect a named ownership invariant.