diff --git a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs index 34d83971..40b0fb2f 100644 --- a/epiphany-core/src/bin/epiphany-mvp-coordinator.rs +++ b/epiphany-core/src/bin/epiphany-mvp-coordinator.rs @@ -23,7 +23,7 @@ use std::time::{Duration, Instant}; mod status_cli; const DEFAULT_APP_SERVER: &str = r"C:\Users\Meta\.cargo-target-codex\debug\codex-app-server.exe"; -const DEFAULT_OPENAI_RUNTIME_BIN: &str = "epiphany-openai-runtime"; +const DEFAULT_MODEL_RUNTIME_BIN: &str = "epiphany-model-runtime"; const REORIENT_BINDING_ID: &str = "reorient-worker"; const GRAPH_NODE_ID: &str = "reorient-target"; const WATCHED_RELATIVE_PATH: &str = "src/reorient_target.rs"; @@ -38,7 +38,8 @@ fn main() -> Result<()> { #[derive(Debug)] struct Args { app_server: PathBuf, - openai_runtime_bin: PathBuf, + model_runtime_bin: PathBuf, + model_provider: String, thread_id: Option, cwd: PathBuf, codex_home: PathBuf, @@ -64,7 +65,8 @@ impl Args { let mut args = env::args().skip(1); let mut parsed = Args { app_server: PathBuf::from(DEFAULT_APP_SERVER), - openai_runtime_bin: PathBuf::from(DEFAULT_OPENAI_RUNTIME_BIN), + model_runtime_bin: PathBuf::from(DEFAULT_MODEL_RUNTIME_BIN), + model_provider: "openai-codex".to_string(), thread_id: None, cwd: root.clone(), codex_home: env::var_os("CODEX_HOME") @@ -88,8 +90,14 @@ impl Args { while let Some(arg) = args.next() { match arg.as_str() { "--app-server" => parsed.app_server = take_path(&mut args, "--app-server")?, + "--model-runtime-bin" => { + parsed.model_runtime_bin = take_path(&mut args, "--model-runtime-bin")?; + } "--openai-runtime-bin" => { - parsed.openai_runtime_bin = take_path(&mut args, "--openai-runtime-bin")?; + parsed.model_runtime_bin = take_path(&mut args, "--openai-runtime-bin")?; + } + "--model-provider" => { + parsed.model_provider = take_string(&mut args, "--model-provider")?; } "--thread-id" => parsed.thread_id = Some(take_string(&mut args, "--thread-id")?), "--cwd" => parsed.cwd = take_path(&mut args, "--cwd")?, @@ -139,7 +147,7 @@ fn run_coordinator(args: &Args) -> Result { let root = env::current_dir().context("failed to resolve current dir")?; let app_server = status_cli::absolute_path(&args.app_server)?; let mut cwd = status_cli::absolute_path(&args.cwd)?; - let openai_runtime_bin = resolve_openai_runtime_bin(&root, &args.openai_runtime_bin)?; + let model_runtime_bin = resolve_model_runtime_bin(&root, &args.model_runtime_bin)?; let codex_home = status_cli::absolute_path(&args.codex_home)?; let artifact_dir = status_cli::absolute_path(&args.artifact_dir)?; let agent_memory_dir = status_cli::absolute_path(&args.agent_memory_dir)?; @@ -372,7 +380,8 @@ fn run_coordinator(args: &Args) -> Result { json!({"type": "roleLaunch", "roleId": role_id, "launch": status_cli::sanitize_for_operator(launch.clone()), "runtimeJobId": worker_job_id}), ); let worker_run = run_worker_runtime( - &openai_runtime_bin, + &model_runtime_bin, + &args.model_provider, &runtime_store, &codex_home, &worker_job_id, @@ -410,7 +419,8 @@ fn run_coordinator(args: &Args) -> Result { json!({"type": "reorientLaunch", "launch": status_cli::sanitize_for_operator(launch.clone()), "runtimeJobId": worker_job_id}), ); let worker_run = run_worker_runtime( - &openai_runtime_bin, + &model_runtime_bin, + &args.model_provider, &runtime_store, &codex_home, &worker_job_id, @@ -465,7 +475,8 @@ fn run_coordinator(args: &Args) -> Result { let summary = json!({ "objective": "Coordinate the Epiphany MVP lanes over existing app-server APIs.", "artifactDir": artifact_dir, - "openaiRuntimeBin": openai_runtime_bin, + "modelRuntimeBin": model_runtime_bin, + "modelProvider": args.model_provider, "codexHome": codex_home, "runtimeStore": runtime_store, "runtimeSpine": runtime_status, @@ -611,7 +622,7 @@ fn collect_coordinator_status( })) } -fn resolve_openai_runtime_bin(root: &Path, configured: &Path) -> Result { +fn resolve_model_runtime_bin(root: &Path, configured: &Path) -> Result { if configured.components().count() != 1 { return status_cli::absolute_path(configured); } @@ -675,7 +686,8 @@ fn worker_job_id_from_launch(launch: &Value) -> Result { } fn run_worker_runtime( - openai_runtime_bin: &Path, + model_runtime_bin: &Path, + model_provider: &str, runtime_store: &Path, codex_home: &Path, job_id: &str, @@ -692,9 +704,11 @@ fn run_worker_runtime( "step-{step_index:02}-{}-worker-runtime.stderr.log", sanitize_id(role_id) )); - let mut command = Command::new(openai_runtime_bin); + let mut command = Command::new(model_runtime_bin); command .arg("run-worker") + .arg("--provider") + .arg(model_provider) .arg("--store") .arg(runtime_store) .arg("--codex-home") @@ -705,7 +719,7 @@ fn run_worker_runtime( .stderr(Stdio::piped()); let mut child = command .spawn() - .with_context(|| format!("failed to spawn {}", openai_runtime_bin.display()))?; + .with_context(|| format!("failed to spawn {}", model_runtime_bin.display()))?; let deadline = Instant::now() + Duration::from_secs(timeout_seconds); loop { if let Some(status) = child.try_wait()? { diff --git a/epiphany-core/src/bin/epiphany-repo-birth-runner.rs b/epiphany-core/src/bin/epiphany-repo-birth-runner.rs index 4156f133..f8aab18b 100644 --- a/epiphany-core/src/bin/epiphany-repo-birth-runner.rs +++ b/epiphany-core/src/bin/epiphany-repo-birth-runner.rs @@ -15,7 +15,7 @@ use std::thread; use std::time::{Duration, Instant}; const DEFAULT_CODEX_BIN: &str = "codex"; -const DEFAULT_OPENAI_RUNTIME_BIN: &str = "epiphany-openai-runtime"; +const DEFAULT_MODEL_RUNTIME_BIN: &str = "epiphany-model-runtime"; const DEFAULT_TIMEOUT_SECONDS: u64 = 900; fn main() -> Result<()> { @@ -35,7 +35,8 @@ struct Args { heartbeat_store: PathBuf, runtime_store: PathBuf, codex_bin: String, - openai_runtime_bin: String, + model_runtime_bin: String, + model_provider: String, executor: String, mode: String, model: Option, @@ -59,8 +60,9 @@ impl Args { heartbeat_store: root.join("state").join("agent-heartbeats.msgpack"), runtime_store: root.join("state").join("runtime-spine.msgpack"), codex_bin: DEFAULT_CODEX_BIN.to_string(), - openai_runtime_bin: DEFAULT_OPENAI_RUNTIME_BIN.to_string(), - executor: "openai-runtime".to_string(), + model_runtime_bin: DEFAULT_MODEL_RUNTIME_BIN.to_string(), + model_provider: "openai-codex".to_string(), + executor: "model-runtime".to_string(), mode: "plan".to_string(), model: None, timeout_seconds: DEFAULT_TIMEOUT_SECONDS, @@ -80,8 +82,14 @@ impl Args { parsed.runtime_store = take_path(&mut args, "--runtime-store")? } "--codex-bin" => parsed.codex_bin = take_string(&mut args, "--codex-bin")?, + "--model-runtime-bin" => { + parsed.model_runtime_bin = take_string(&mut args, "--model-runtime-bin")?; + } "--openai-runtime-bin" => { - parsed.openai_runtime_bin = take_string(&mut args, "--openai-runtime-bin")?; + parsed.model_runtime_bin = take_string(&mut args, "--openai-runtime-bin")?; + } + "--model-provider" => { + parsed.model_provider = take_string(&mut args, "--model-provider")?; } "--executor" => parsed.executor = take_string(&mut args, "--executor")?, "--mode" => parsed.mode = take_string(&mut args, "--mode")?, @@ -97,8 +105,11 @@ impl Args { if !matches!(parsed.mode.as_str(), "plan" | "run") { return Err(anyhow!("--mode must be plan or run")); } - if !matches!(parsed.executor.as_str(), "openai-runtime" | "codex-exec") { - return Err(anyhow!("--executor must be openai-runtime or codex-exec")); + if parsed.executor == "openai-runtime" { + parsed.executor = "model-runtime".to_string(); + } + if !matches!(parsed.executor.as_str(), "model-runtime" | "codex-exec") { + return Err(anyhow!("--executor must be model-runtime or codex-exec")); } Ok(parsed) } @@ -135,7 +146,7 @@ fn run(args: Args) -> Result { let schema_path = execution_dir.join("output-schema.json"); let result_path = execution_dir.join("result.json"); let request_path = execution_dir.join("openai-request.json"); - let runtime_summary_path = execution_dir.join("openai-runtime-summary.json"); + let runtime_summary_path = execution_dir.join("model-runtime-summary.json"); let stdout_path = execution_dir.join("executor.stdout.log"); let stderr_path = execution_dir.join("executor.stderr.log"); let prompt = render_specialist_prompt(kind, &packet_value)?; @@ -156,6 +167,8 @@ fn run(args: Args) -> Result { "stdoutPath": stdout_path, "stderrPath": stderr_path, "executor": args.executor.clone(), + "modelRuntimeBin": args.model_runtime_bin.clone(), + "modelProvider": args.model_provider.clone(), "status": "planned", "acceptCommand": accept_command(kind, &args, &packet_path, &result_path), }); @@ -216,6 +229,8 @@ fn run(args: Args) -> Result { "heartbeatStore": args.heartbeat_store, "runtimeStore": args.runtime_store, "executor": args.executor, + "modelRuntimeBin": args.model_runtime_bin, + "modelProvider": args.model_provider, "startup": startup, "executions": executions, "requiresReview": !args.auto_accept, @@ -339,9 +354,11 @@ fn run_openai_runtime_specialist( }); write_json(request_path, &request)?; - let mut command = Command::new(&args.openai_runtime_bin); + let mut command = Command::new(&args.model_runtime_bin); command .arg("model-turn") + .arg("--provider") + .arg(&args.model_provider) .arg("--store") .arg(&args.runtime_store) .arg("--request") @@ -356,7 +373,7 @@ fn run_openai_runtime_specialist( .stderr(Stdio::piped()); let child = command .spawn() - .context("failed to spawn epiphany-openai-runtime model-turn")?; + .context("failed to spawn model runtime model-turn")?; wait_for_child( child, args.timeout_seconds, diff --git a/epiphany-openai-runtime/Cargo.toml b/epiphany-openai-runtime/Cargo.toml index 11b0db83..ad9b8a58 100644 --- a/epiphany-openai-runtime/Cargo.toml +++ b/epiphany-openai-runtime/Cargo.toml @@ -28,6 +28,10 @@ tempfile = "3" name = "epiphany-openai-runtime" path = "src/bin/epiphany-openai-runtime.rs" +[[bin]] +name = "epiphany-model-runtime" +path = "src/bin/epiphany-model-runtime.rs" + [patch.crates-io] tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "132f5b39c862e3a970f731d709608b3e6276d5f6" } tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "9200079d3b54a1ff51072e24d81fd354f085156f" } diff --git a/epiphany-openai-runtime/src/bin/epiphany-model-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-model-runtime.rs new file mode 100644 index 00000000..00d98da6 --- /dev/null +++ b/epiphany-openai-runtime/src/bin/epiphany-model-runtime.rs @@ -0,0 +1 @@ +include!("epiphany-openai-runtime.rs"); diff --git a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs index d45d8df5..11018974 100644 --- a/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs +++ b/epiphany-openai-runtime/src/bin/epiphany-openai-runtime.rs @@ -24,6 +24,7 @@ use serde_json::json; use uuid::Uuid; const DEFAULT_STORE: &str = "state/runtime-spine.msgpack"; +const DEFAULT_PROVIDER: &str = "openai-codex"; #[tokio::main] async fn main() -> Result<()> { @@ -32,6 +33,7 @@ async fn main() -> Result<()> { match command.as_str() { "model-turn" => { let options = parse_model_turn_options(args.collect())?; + require_supported_provider(&options.provider)?; let request_text = fs::read_to_string(&options.request_path) .with_context(|| format!("failed to read {}", options.request_path.display()))?; let request: EpiphanyOpenAiModelRequest = serde_json::from_str(&request_text) @@ -51,6 +53,7 @@ async fn main() -> Result<()> { } "run-worker" => { let options = parse_run_worker_options(args.collect())?; + require_supported_provider(&options.provider)?; let summary = run_worker_launch(EpiphanyWorkerRuntimeOptions { store_path: options.store_path, codex_home: options.codex_home, @@ -62,6 +65,7 @@ async fn main() -> Result<()> { } "smoke" => { let options = parse_smoke_options(args.collect())?; + require_supported_provider(&options.provider)?; let mut request = EpiphanyOpenAiModelRequest::new( "smoke-request", "smoke-conversation", @@ -90,7 +94,8 @@ async fn main() -> Result<()> { session_id: runtime_options.session_id.clone(), role: OPENAI_RUNTIME_ROLE.to_string(), created_at: now(), - summary: "Smoke typed OpenAI runtime route.".to_string(), + summary: "Smoke typed model runtime route through the OpenAI/Codex provider." + .to_string(), artifact_refs: Vec::new(), }, )?; @@ -121,6 +126,7 @@ async fn main() -> Result<()> { } struct ModelTurnCliOptions { + provider: String, store_path: PathBuf, codex_home: PathBuf, request_path: PathBuf, @@ -154,11 +160,13 @@ impl ModelTurnCliOptions { } struct SmokeCliOptions { + provider: String, store_path: PathBuf, codex_home: PathBuf, } struct RunWorkerCliOptions { + provider: String, store_path: PathBuf, codex_home: PathBuf, job_id: String, @@ -166,6 +174,7 @@ struct RunWorkerCliOptions { } fn parse_model_turn_options(args: Vec) -> Result { + let mut provider = DEFAULT_PROVIDER.to_string(); let mut store_path = PathBuf::from(DEFAULT_STORE); let mut codex_home = default_codex_home()?; let mut request_path = None; @@ -177,6 +186,7 @@ fn parse_model_turn_options(args: Vec) -> Result { let mut iter = args.into_iter(); while let Some(arg) = iter.next() { match arg.as_str() { + "--provider" => provider = next_value(&mut iter, "--provider")?, "--store" => store_path = PathBuf::from(next_value(&mut iter, "--store")?), "--codex-home" => codex_home = PathBuf::from(next_value(&mut iter, "--codex-home")?), "--request" => request_path = Some(PathBuf::from(next_value(&mut iter, "--request")?)), @@ -194,6 +204,7 @@ fn parse_model_turn_options(args: Vec) -> Result { } } Ok(ModelTurnCliOptions { + provider, store_path, codex_home, request_path: request_path.context("model-turn requires --request")?, @@ -206,6 +217,7 @@ fn parse_model_turn_options(args: Vec) -> Result { } fn parse_run_worker_options(args: Vec) -> Result { + let mut provider = DEFAULT_PROVIDER.to_string(); let mut store_path = PathBuf::from(DEFAULT_STORE); let mut codex_home = default_codex_home()?; let mut job_id = None; @@ -213,6 +225,7 @@ fn parse_run_worker_options(args: Vec) -> Result { let mut iter = args.into_iter(); while let Some(arg) = iter.next() { match arg.as_str() { + "--provider" => provider = next_value(&mut iter, "--provider")?, "--store" => store_path = PathBuf::from(next_value(&mut iter, "--store")?), "--codex-home" => codex_home = PathBuf::from(next_value(&mut iter, "--codex-home")?), "--job-id" => job_id = Some(next_value(&mut iter, "--job-id")?), @@ -221,6 +234,7 @@ fn parse_run_worker_options(args: Vec) -> Result { } } Ok(RunWorkerCliOptions { + provider, store_path, codex_home, job_id: job_id.context("run-worker requires --job-id")?, @@ -229,25 +243,37 @@ fn parse_run_worker_options(args: Vec) -> Result { } fn parse_smoke_options(args: Vec) -> Result { + let mut provider = DEFAULT_PROVIDER.to_string(); let mut store_path = PathBuf::from(format!( - ".epiphany-dogfood/openai-runtime/smoke-{}.msgpack", + ".epiphany-dogfood/model-runtime/smoke-{}.msgpack", Uuid::new_v4() )); let mut codex_home = default_codex_home()?; let mut iter = args.into_iter(); while let Some(arg) = iter.next() { match arg.as_str() { + "--provider" => provider = next_value(&mut iter, "--provider")?, "--store" => store_path = PathBuf::from(next_value(&mut iter, "--store")?), "--codex-home" => codex_home = PathBuf::from(next_value(&mut iter, "--codex-home")?), other => return Err(anyhow!("unknown smoke argument: {other}")), } } Ok(SmokeCliOptions { + provider, store_path, codex_home, }) } +fn require_supported_provider(provider: &str) -> Result<()> { + if matches!(provider, "openai-codex" | "openai") { + return Ok(()); + } + Err(anyhow!( + "unsupported model runtime provider {provider:?}; current providers: openai-codex" + )) +} + fn next_value(iter: &mut impl Iterator, name: &str) -> Result { iter.next() .ok_or_else(|| anyhow!("{name} requires a value")) @@ -263,5 +289,5 @@ fn now() -> String { } fn usage() -> &'static str { - "usage: epiphany-openai-runtime [--store path] [--codex-home path] [--request path] [--session-id id] [--job-id id] [--objective text] [--default-model model] [--output-last-message path]" + "usage: epiphany-model-runtime [--provider openai-codex] [--store path] [--codex-home path] [--request path] [--session-id id] [--job-id id] [--objective text] [--default-model model] [--output-last-message path]" } diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index a0871d7b..cf4279ce 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -907,6 +907,11 @@ mod tests { }, ), output_contract_id: epiphany_core::ROLE_WORKER_OUTPUT_CONTRACT_ID.to_string(), + organ_launch_contract: epiphany_core::default_launch_organ_contract( + "epiphany.role.modeling", + "role", + epiphany_core::ROLE_WORKER_OUTPUT_CONTRACT_ID, + ), created_at: now(), }, )?; diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 7cbe4fef..70f26841 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -37,6 +37,7 @@ remembers doctrine; the branch remembers the blade. - Local operator runs now write typed CultMesh intent/receipt documents to `.epiphany-run/cultmesh/operator-runs.ccmp` through `epiphany-operator-run`. The wrapper writes intent before acting and a completion receipt after success; this is the local consent/trace rail, not a hidden scheduler queue. - Status-mode local runs now also write a native CultMesh operator snapshot to `.epiphany-run/cultmesh/operator-snapshots.ccmp` through `epiphany-operator-snapshot`. That snapshot distills the operator-safe MVP status artifact into typed fields such as thread id, state status, coordinator action, CRRC action, reorient action, available actions, and artifact refs; it does not preserve the raw JSON status blob as internal state. - `epiphany-mvp-status --source native` is the current provider-neutral status boundary. It projects scene, pressure, jobs, roles, planning, reorient, CRRC, and coordinator status from native core surfaces and returns provider/runtime worker results as `backendMissing` placeholders instead of asking Codex for model-worker state. Keep future pluggable model-provider work behind launch/result/runtime documents; do not let provider choice leak into status, prompt authority, scheduler policy, or durable `EpiphanyThreadState`. +- `epiphany-model-runtime` is the current provider-neutral executable boundary. It is built by the `epiphany-openai-runtime` crate for now and accepts `--provider openai-codex`; the old `epiphany-openai-runtime` binary, `--openai-runtime-bin`, and `openai-runtime` executor name survive only as compatibility aliases. Coordinator run mode, local wrapper run mode, and repo birth runner should call `--model-runtime-bin` plus `--model-provider`. Next provider work should replace OpenAI-named request/event/receipt documents with provider-neutral model documents and keep OpenAI/Codex as one adapter projection behind that boundary. - The active foundation directive is now `notes/codex-starvation-and-cultnet-liberation-plan.md`. The previous Codex app-server control-plane rebuild made Epiphany less rotten inside Codex, but that is not the destination. Epiphany must become a native CultCache/CultMesh/CultNet runtime while remaining an honest modified Codex-derived backend for subscription auth/model use. Codex should remain relatively vanilla and keep doing Codex things, including useful app-server and streaming bridge affordances, but it must not own Epiphany state, processes, prompts, scheduler decisions, or policy. The bridge handles interop; Codex and Epiphany do not get to rummage around in each other's organs. - `notes/epiphany-cultmesh-dreaming-roadmap.md` is the new concrete design for distributed Epiphany dreaming. The invariant is hard: private state stays local; public dreams are separately authored typed documents distributed through CultMesh/CultNet; foreign dreams are thought weather until a reviewed local adoption receipt digests them. The first code slice should be dream schemas plus a local CultMesh-backed store, not public fanout. - CultMesh is now the preferred Rust abstraction for that local store work. The compile-time Rust substrate is repo-contained: `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`. The old `E:\Projects\CultLib\crates\*` dependency body is dead in this checkout and must not be revived by accident. Vendored CultCache reads/writes `cultcache.store.v1`, so `state/ledgers.msgpack` and `epiphany-state status` are aligned again. The first integrations are deliberately small: status, Verse policy, global room policy, organ contract policy, native operator status, native operator snapshots, and local operator run intent/receipt round-trip through CultMesh. Use `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-status -- smoke --store .\.epiphany-smoke\cultmesh\operator-status.ccmp --runtime-id epiphany-cultmesh-status-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-snapshot -- smoke --store .\.epiphany-smoke\cultmesh\operator-snapshots.ccmp --runtime-id epiphany-operator-snapshot-smoke --snapshot-id smoke-status`, and `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-run -- smoke --store .\.epiphany-smoke\cultmesh\operator-runs.ccmp --runtime-id epiphany-operator-run-smoke --run-id smoke-run` for the focused proofs. Future local dream/status/Verse work should start from CultMesh, not raw CultNet, unless the task is polishing the CultMesh internals themselves. Preserve the three Verse tiers: `epiphany-internal` for private sub-agent typed state, `gamecult-local` for trusted LAN/Yggdrasil-tunnel GameCult sharing, and `epiphany-global` for untrusted public dreams plus topic-specific threaded public rooms for Face posts. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index cfb856e2..5673dd09 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 276f1a30..93fea753 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -504,4 +504,15 @@ current_status: and still writes operator intent, status artifact, snapshot, and completion receipt. Codex status remains as a compatibility source for legacy smokes and bridge-equipped coordinator paths, not the MVP status authority. - next_action: Continue Codex starvation and CultNet liberation by moving coordinator plan/run outputs into typed CultNet receipts and by defining a narrow provider/runtime boundary so future non-OpenAI providers can swap behind Epiphany-owned launch/result documents without touching status, scheduler, prompts, or durable state. + The first provider-neutral runtime seam is landed too: + `epiphany-openai-runtime` now also builds `epiphany-model-runtime`, whose + CLI accepts `--provider openai-codex` and owns the current + `model-turn`/`run-worker`/`smoke` executable contract. Coordinator run mode, + the local wrapper, and repo birth runner now default to + `--model-runtime-bin` plus `--model-provider`; old `--openai-runtime-bin` + and `openai-runtime` executor names remain compatibility aliases. This + does not make OpenAI generic internally yet: the current provider still + uses typed OpenAI request/event/receipt documents through the Codex auth + reliquary. It does move provider selection out of scheduler/status/state + surfaces and into one runtime executable boundary. + next_action: Continue Codex starvation and CultNet liberation by moving coordinator plan/run outputs into typed CultNet receipts and by replacing OpenAI-specific request/event/receipt document names with provider-neutral model request/event/receipt documents plus OpenAI/Codex adapter projection behind the runtime boundary. diff --git a/tools/epiphany_local_run.ps1 b/tools/epiphany_local_run.ps1 index f659b087..4be3d485 100644 --- a/tools/epiphany_local_run.ps1 +++ b/tools/epiphany_local_run.ps1 @@ -78,7 +78,8 @@ $operatorRunExe = Join-Path $TargetDir "debug\epiphany-operator-run.exe" $operatorSnapshotExe = Join-Path $TargetDir "debug\epiphany-operator-snapshot.exe" $coordinatorExe = Join-Path $TargetDir "debug\epiphany-mvp-coordinator.exe" $coordinatorSmokeExe = Join-Path $TargetDir "debug\epiphany-mvp-coordinator-smoke.exe" -$openaiRuntimeExe = Join-Path $TargetDir "debug\epiphany-openai-runtime.exe" +$modelRuntimeExe = Join-Path $TargetDir "debug\epiphany-model-runtime.exe" +$modelProvider = "openai-codex" $operatorRunStore = Join-Path $Root ".epiphany-run\cultmesh\operator-runs.ccmp" $operatorSnapshotStore = Join-Path $Root ".epiphany-run\cultmesh\operator-snapshots.ccmp" $operatorSnapshotId = "$runId-status" @@ -116,12 +117,12 @@ if (-not $SkipBuild) { if ($Mode -eq "run") { Invoke-Checked ` - -Label "build Epiphany OpenAI runtime" ` + -Label "build Epiphany model runtime" ` -FilePath "cargo" ` - -Arguments @("build", "--manifest-path", ".\epiphany-openai-runtime\Cargo.toml", "--bin", "epiphany-openai-runtime") ` + -Arguments @("build", "--manifest-path", ".\epiphany-openai-runtime\Cargo.toml", "--bin", "epiphany-model-runtime") ` -WorkingDirectory $Root ` - -StdoutPath (Join-Path $artifactRoot "build-openai-runtime.stdout.log") ` - -StderrPath (Join-Path $artifactRoot "build-openai-runtime.stderr.log") + -StdoutPath (Join-Path $artifactRoot "build-model-runtime.stdout.log") ` + -StderrPath (Join-Path $artifactRoot "build-model-runtime.stderr.log") } } @@ -252,12 +253,13 @@ if ($Mode -eq "smoke") { if ($Mode -eq "run") { $resultPath = Join-Path $artifactRoot "coordinator-run.stdout.json" - if (-not (Test-Path -LiteralPath $openaiRuntimeExe)) { - throw "required runtime binary not found: $openaiRuntimeExe" + if (-not (Test-Path -LiteralPath $modelRuntimeExe)) { + throw "required runtime binary not found: $modelRuntimeExe" } $runArgs = @( "--app-server", $codexAppServer, - "--openai-runtime-bin", $openaiRuntimeExe, + "--model-runtime-bin", $modelRuntimeExe, + "--model-provider", $modelProvider, "--codex-home", $CodexHome, "--cwd", $Workspace, "--artifact-dir", (Join-Path $dogfoodRoot "coordinator"), @@ -299,7 +301,8 @@ $summary = @" - operatorSnapshotBinary: $operatorSnapshotExe - operatorSnapshotStore: $operatorSnapshotStore - coordinatorBinary: $coordinatorExe -- openaiRuntimeBinary: $openaiRuntimeExe +- modelRuntimeBinary: $modelRuntimeExe +- modelProvider: $modelProvider This is an operator entrypoint over the current MVP shell. Status mode is Epiphany-native and does not start Codex app-server; coordinator plan/smoke/run