Keep worker launch documents typed

This commit is contained in:
Meta Vens 2026-05-20 07:41:00 +01:00
commit 4221580e95
5 changed files with 11 additions and 6 deletions

View file

@ -601,7 +601,7 @@ pub fn build_epiphany_job_launch_request(
linked_subgoal_ids: Vec<String>,
linked_graph_node_ids: Vec<String>,
instruction: String,
launch_document: ThreadEpiphanyWorkerLaunchDocument,
launch_document: EpiphanyWorkerLaunchDocument,
output_contract_id: String,
max_runtime_seconds: Option<u64>,
) -> EpiphanyJobLaunchRequest {
@ -615,7 +615,7 @@ pub fn build_epiphany_job_launch_request(
linked_subgoal_ids,
linked_graph_node_ids,
instruction,
launch_document: map_core_worker_launch_document(launch_document),
launch_document,
output_contract_id,
max_runtime_seconds,
}

View file

@ -64,6 +64,7 @@ remembers doctrine; the branch remembers the blade.
- Changed-field authority is native now. `EpiphanyStateUpdatedField` lives in `epiphany-core`; bridge mutation results carry that typed enum, while app-server projects it into `ThreadEpiphanyStateUpdatedField` only for JSON-RPC responses and notifications.
- 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`.
- 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

@ -346,7 +346,9 @@ current_status:
use core `EpiphanyRoleResultRoleId` internally; app-server maps
`ThreadEpiphanyRoleId` at the request/response edge. Reorient launch
service results now use typed `EpiphanySurfaceSource`; app-server maps that
to `ThreadEpiphanyReorientSource` only for the legacy response. The bridge
still depends on vendored Codex for app-server protocol DTOs and absolute
path validation, so the purification is not done.
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`.
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.

View file

@ -20,6 +20,7 @@ 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::launch::map_core_worker_launch_document;
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;
@ -622,6 +623,7 @@ impl CodexMessageProcessor {
};
let host = EpiphanyCodexThreadHost::new(thread.as_ref());
let core_launch_document = map_core_worker_launch_document(launch_document);
let applied = match launch_thread_epiphany_job(
&host,
build_epiphany_job_launch_request(
@ -634,7 +636,7 @@ impl CodexMessageProcessor {
linked_subgoal_ids,
linked_graph_node_ids,
instruction,
launch_document,
core_launch_document,
output_contract_id,
max_runtime_seconds,
),