Record coordinator jobs in native runtime spine

This commit is contained in:
Meta Vens 2026-05-06 09:23:22 +01:00
commit 68e224e307
6 changed files with 308 additions and 10 deletions

View file

@ -1,6 +1,18 @@
use anyhow::Context;
use anyhow::Result;
use anyhow::anyhow;
use chrono::SecondsFormat;
use epiphany_core::RuntimeSpineEventOptions;
use epiphany_core::RuntimeSpineInitOptions;
use epiphany_core::RuntimeSpineJobOptions;
use epiphany_core::RuntimeSpineJobResultOptions;
use epiphany_core::RuntimeSpineSessionOptions;
use epiphany_core::append_runtime_event;
use epiphany_core::complete_runtime_job;
use epiphany_core::create_runtime_job;
use epiphany_core::create_runtime_session;
use epiphany_core::initialize_runtime_spine;
use epiphany_core::runtime_spine_status;
use serde_json::Value;
use serde_json::json;
use std::env;
@ -33,6 +45,7 @@ struct Args {
codex_home: PathBuf,
artifact_dir: PathBuf,
agent_memory_dir: PathBuf,
runtime_store: PathBuf,
mode: String,
max_steps: usize,
poll_seconds: f64,
@ -59,6 +72,7 @@ impl Args {
.unwrap_or_else(|| home_dir().join(".codex")),
artifact_dir: root.join(".epiphany-dogfood").join("coordinator"),
agent_memory_dir: root.join("state").join("agents.msgpack"),
runtime_store: root.join("state").join("runtime-spine.msgpack"),
mode: "plan".to_string(),
max_steps: 4,
poll_seconds: 5.0,
@ -81,6 +95,9 @@ impl Args {
"--agent-memory-dir" => {
parsed.agent_memory_dir = take_path(&mut args, "--agent-memory-dir")?;
}
"--runtime-store" => {
parsed.runtime_store = take_path(&mut args, "--runtime-store")?
}
"--mode" => parsed.mode = take_string(&mut args, "--mode")?,
"--max-steps" => {
parsed.max_steps = take_string(&mut args, "--max-steps")?.parse()?
@ -121,6 +138,7 @@ fn run_coordinator(args: &Args) -> Result<Value> {
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)?;
let runtime_store = status_cli::absolute_path(&args.runtime_store)?;
reset_artifact_dir(&artifact_dir)?;
fs::create_dir_all(&codex_home)?;
if args.bootstrap_smoke_state {
@ -171,6 +189,57 @@ fn run_coordinator(args: &Args) -> Result<Value> {
startup_events.push(thread_lifecycle_event("threadStart", &started));
text_at(&started, &["thread", "id"])?
};
let runtime_session_id = format!("coordinator-{thread_id}");
let runtime_identity = initialize_runtime_spine(
&runtime_store,
RuntimeSpineInitOptions {
runtime_id: "epiphany-local".to_string(),
display_name: "Epiphany Local".to_string(),
created_at: now(),
},
)?;
let runtime_session = ensure_runtime_session(
&runtime_store,
&runtime_session_id,
"Coordinate the Epiphany MVP lanes with native runtime job receipts.",
)?;
let runtime_event = append_runtime_event(
&runtime_store,
RuntimeSpineEventOptions {
event_id: format!("event-coordinator-started-{}", sanitize_id(&thread_id)),
occurred_at: now(),
event_type: "coordinator.started".to_string(),
source: "epiphany-mvp-coordinator".to_string(),
session_id: Some(runtime_session_id.clone()),
job_id: None,
summary: "Native coordinator session opened.".to_string(),
},
)
.or_else(|_| {
append_runtime_event(
&runtime_store,
RuntimeSpineEventOptions {
event_id: format!(
"event-coordinator-started-{}-{}",
sanitize_id(&thread_id),
uuid::Uuid::new_v4()
),
occurred_at: now(),
event_type: "coordinator.started".to_string(),
source: "epiphany-mvp-coordinator".to_string(),
session_id: Some(runtime_session_id.clone()),
job_id: None,
summary: "Native coordinator session opened.".to_string(),
},
)
})?;
startup_events.push(json!({
"type": "runtimeSpineSession",
"store": runtime_store,
"runtimeId": runtime_identity.runtime_id,
"sessionId": runtime_session.session_id,
"eventId": runtime_event.event_id,
}));
if args.bootstrap_smoke_state {
client.send(
@ -292,14 +361,23 @@ fn run_coordinator(args: &Args) -> Result<Value> {
revision,
args.max_runtime_seconds,
)?;
let native_job = open_native_job(
&runtime_store,
&runtime_session_id,
role_id,
&launch,
"Role specialist launched through temporary execution bridge.",
)?;
push_event(
&mut step,
json!({"type": "roleLaunch", "roleId": role_id, "launch": status_cli::sanitize_for_operator(launch.clone())}),
json!({"type": "roleLaunch", "roleId": role_id, "launch": status_cli::sanitize_for_operator(launch.clone()), "runtimeJob": native_job}),
);
let result = wait_for_role_result(&mut client, &thread_id, role_id, args)?;
let native_result =
maybe_complete_native_job(&runtime_store, &native_job, &result, role_id)?;
push_event(
&mut step,
json!({"type": "roleResult", "roleId": role_id, "result": status_cli::sanitize_for_operator(result.clone())}),
json!({"type": "roleResult", "roleId": role_id, "result": status_cli::sanitize_for_operator(result.clone()), "runtimeResult": native_result}),
);
final_status = collect_coordinator_status(&mut client, &thread_id)?;
if !args.auto_review {
@ -315,14 +393,27 @@ fn run_coordinator(args: &Args) -> Result<Value> {
"launchReorientWorker" => {
let launch =
launch_reorient(&mut client, &thread_id, revision, args.max_runtime_seconds)?;
let native_job = open_native_job(
&runtime_store,
&runtime_session_id,
"reorient-worker",
&launch,
"Reorient worker launched through temporary execution bridge.",
)?;
push_event(
&mut step,
json!({"type": "reorientLaunch", "launch": status_cli::sanitize_for_operator(launch.clone())}),
json!({"type": "reorientLaunch", "launch": status_cli::sanitize_for_operator(launch.clone()), "runtimeJob": native_job}),
);
let result = wait_for_reorient_result(&mut client, &thread_id, args)?;
let native_result = maybe_complete_native_job(
&runtime_store,
&native_job,
&result,
"reorient-worker",
)?;
push_event(
&mut step,
json!({"type": "reorientResult", "result": status_cli::sanitize_for_operator(result.clone())}),
json!({"type": "reorientResult", "result": status_cli::sanitize_for_operator(result.clone()), "runtimeResult": native_result}),
);
final_status = collect_coordinator_status(&mut client, &thread_id)?;
if !args.auto_review {
@ -355,12 +446,15 @@ fn run_coordinator(args: &Args) -> Result<Value> {
}
let operator_final_status = status_cli::sanitize_for_operator(final_status);
let runtime_status = runtime_spine_status(&runtime_store)?;
let final_rendered = status_cli::render_status(&operator_final_status);
let operator_steps = status_cli::sanitize_for_operator(Value::Array(steps));
let summary = json!({
"objective": "Coordinate the Epiphany MVP lanes over existing app-server APIs.",
"artifactDir": artifact_dir,
"codexHome": codex_home,
"runtimeStore": runtime_store,
"runtimeSpine": runtime_status,
"workspace": cwd,
"threadId": operator_final_status["threadId"],
"mode": args.mode,
@ -375,7 +469,8 @@ fn run_coordinator(args: &Args) -> Result<Value> {
"coordinator-final-status.json",
"coordinator-final-status.txt",
"coordinator-final-action.txt",
"agent-function-telemetry.json"
"agent-function-telemetry.json",
"runtime-spine-status.json"
],
"sealedArtifactManifest": [
{"path": "epiphany-transcript.jsonl", "reason": "sealed JSON-RPC audit trail; do not read during normal supervision"},
@ -387,6 +482,10 @@ fn run_coordinator(args: &Args) -> Result<Value> {
&artifact_dir.join("coordinator-final-status.json"),
&summary["finalStatus"],
)?;
write_json(
&artifact_dir.join("runtime-spine-status.json"),
&summary["runtimeSpine"],
)?;
fs::write(
artifact_dir.join("coordinator-final-status.txt"),
final_rendered,
@ -624,6 +723,200 @@ fn maybe_apply_role_self_patch(accepted: &Value, agent_memory_dir: &Path) -> Res
Ok(Some(output))
}
fn ensure_runtime_session(
runtime_store: &Path,
session_id: &str,
objective: &str,
) -> Result<epiphany_core::EpiphanyRuntimeSession> {
match create_runtime_session(
runtime_store,
RuntimeSpineSessionOptions {
session_id: session_id.to_string(),
objective: objective.to_string(),
created_at: now(),
coordinator_note:
"Coordinator owns native runtime receipts before Codex execution dies.".to_string(),
},
) {
Ok(session) => Ok(session),
Err(err) if err.to_string().contains("already exists") => {
let mut cache = epiphany_core::runtime_spine_cache(runtime_store)?;
cache.pull_all_backing_stores()?;
cache.get_required::<epiphany_core::EpiphanyRuntimeSession>(session_id)
}
Err(err) => Err(err),
}
}
fn open_native_job(
runtime_store: &Path,
session_id: &str,
role_id: &str,
launch: &Value,
summary: &str,
) -> Result<Value> {
let bridge_job_id = first_string_at(
launch,
&[
&["job", "id"],
&["job", "backendJobId"],
&["job", "runtimeAgentJobId"],
&["backendJobId"],
&["runtimeAgentJobId"],
],
)
.unwrap_or_else(|| uuid::Uuid::new_v4().to_string());
let native_job_id = format!("{}-{}", sanitize_id(role_id), sanitize_id(&bridge_job_id));
let job = match create_runtime_job(
runtime_store,
RuntimeSpineJobOptions {
job_id: native_job_id.clone(),
session_id: session_id.to_string(),
role: role_id.to_string(),
created_at: now(),
summary: summary.to_string(),
artifact_refs: Vec::new(),
},
) {
Ok(job) => job,
Err(err) if err.to_string().contains("already exists") => {
let mut cache = epiphany_core::runtime_spine_cache(runtime_store)?;
cache.pull_all_backing_stores()?;
cache.get_required::<epiphany_core::EpiphanyRuntimeJob>(&native_job_id)?
}
Err(err) => return Err(err),
};
Ok(json!({
"jobId": job.job_id,
"role": job.role,
"status": format!("{:?}", job.status),
"bridgeJobId": bridge_job_id,
}))
}
fn maybe_complete_native_job(
runtime_store: &Path,
runtime_job: &Value,
result: &Value,
role_id: &str,
) -> Result<Value> {
let status = result["status"].as_str().unwrap_or("unknown");
if !matches!(status, "completed" | "failed" | "cancelled") {
return Ok(json!({
"status": "pending",
"reason": "Bridge result is not terminal.",
}));
}
let job_id = runtime_job["jobId"]
.as_str()
.ok_or_else(|| anyhow!("runtime job event did not include jobId"))?;
let result_id = format!("result-{job_id}");
let summary = first_string_at(
result,
&[
&["finding", "summary"],
&["finding", "nextSafeMove"],
&["note"],
&["jobError"],
],
)
.unwrap_or_else(|| format!("Bridge result status: {status}."));
let next_safe_move = first_string_at(result, &[&["finding", "nextSafeMove"]])
.unwrap_or_else(|| "Review the native runtime result.".to_string());
let verdict =
first_string_at(result, &[&["finding", "verdict"]]).unwrap_or_else(|| status.to_string());
match complete_runtime_job(
runtime_store,
RuntimeSpineJobResultOptions {
result_id: result_id.clone(),
job_id: job_id.to_string(),
completed_at: now(),
verdict,
summary,
next_safe_move,
evidence_refs: strings_at(result, &["finding", "evidenceIds"]),
artifact_refs: strings_at(result, &["finding", "artifactRefs"]),
},
) {
Ok(completed) => Ok(json!({
"status": "completed",
"resultId": completed.result_id,
"jobId": completed.job_id,
"role": completed.role,
"verdict": completed.verdict,
})),
Err(err) if err.to_string().contains("already terminal") => Ok(json!({
"status": "alreadyTerminal",
"jobId": job_id,
"role": role_id,
})),
Err(err) if err.to_string().contains("already exists") => Ok(json!({
"status": "alreadyRecorded",
"resultId": result_id,
"jobId": job_id,
"role": role_id,
})),
Err(err) => Err(err),
}
}
fn first_string_at(value: &Value, paths: &[&[&str]]) -> Option<String> {
'paths: for path in paths {
let mut cursor = value;
for key in *path {
let Some(next) = cursor.get(*key) else {
continue 'paths;
};
cursor = next;
}
if let Some(value) = cursor.as_str()
&& !value.trim().is_empty()
{
return Some(value.to_string());
}
}
None
}
fn strings_at(value: &Value, path: &[&str]) -> Vec<String> {
let mut cursor = value;
for key in path {
let Some(next) = cursor.get(*key) else {
return Vec::new();
};
cursor = next;
}
cursor
.as_array()
.map(|items| {
items
.iter()
.filter_map(Value::as_str)
.map(ToString::to_string)
.collect()
})
.unwrap_or_default()
}
fn sanitize_id(value: &str) -> String {
value
.chars()
.map(|ch| {
if ch.is_ascii_alphanumeric() || ch == '-' || ch == '_' {
ch
} else {
'-'
}
})
.collect::<String>()
.trim_matches('-')
.to_string()
}
fn now() -> String {
chrono::Utc::now().to_rfc3339_opts(SecondsFormat::Secs, true)
}
fn reorient_patch() -> Value {
json!({
"objective": "Decide whether a durable checkpoint still deserves to be resumed after rehydrate.",

View file

@ -84,7 +84,7 @@ The landed machine now has:
- review-gated Phase 6 modeling acceptance through `thread/epiphany/roleAccept`, limited to completed modeling/checkpoint `statePatch` findings that apply graph/frontier/checkpoint/scratch/investigation-checkpoint changes through the existing state validator
- first Phase 6 dogfood operator view through native `epiphany-mvp-status`
- first auditable Phase 6 dogfood runner through `tools/epiphany_mvp_dogfood.py`, producing local status snapshots, sealed app-server transcript diagnostics, operator-safe final status artifacts, truthful vanilla-reference output, and comparison notes
- first auditable Phase 6 fixed-lane coordinator runner through native `epiphany-mvp-coordinator`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, and final next-action artifacts while keeping semantic findings review-gated by default
- first auditable Phase 6 fixed-lane coordinator runner through native `epiphany-mvp-coordinator`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, runtime-spine status, native runtime job/result receipts for launched work, and final next-action artifacts while keeping semantic findings review-gated by default
- first Codex-independent native runtime vertebra through `epiphany-runtime-spine`, storing runtime identity, sessions, jobs, job results, and events as typed CultCache MessagePack documents, opening/completing native jobs, projecting job-result counts, and emitting a framed CultNet hello message for the native contract
- first auditable Phase 6 live-specialist runner through `tools/epiphany_mvp_live_specialist.py`, proving `roleLaunch -> agent_jobs worker -> report_agent_job_result -> roleResult` without manual backend completion
- first Phase 6 Aquarium operator shell extracted to sibling repo `E:\Projects\EpiphanyAquarium`, a Tauri v2 + React/WebGL client over the existing status bridge, dogfood artifacts, and GUI action artifacts, with its own distilled interface state/memory/doctrine plus durable checkpoint preparation, bounded status/coordinator artifact buttons, fixed modeling/verification/reorient launch and read-back buttons, and explicit review-gated reorient acceptance

View file

@ -33,7 +33,7 @@ remembers doctrine; the branch remembers the blade.
- Phase 1 through Phase 5 are complete enough.
- Phase 6 has read-only `thread/epiphany/scene`, `thread/epiphany/jobs`, `thread/epiphany/roles`, `thread/epiphany/freshness`, `thread/epiphany/context`, `thread/epiphany/graphQuery`, `thread/epiphany/planning`, `thread/epiphany/pressure`, `thread/epiphany/reorient`, `thread/epiphany/crrc`, `thread/epiphany/coordinator`, `thread/epiphany/reorientResult`, and `thread/epiphany/roleResult`; durable `jobBindings` now act as a thin Epiphany-owned launcher seam with launcher id, authority scope, and backend kind/job id, `thread/epiphany/jobLaunch` / `thread/epiphany/jobInterrupt` / `thread/epiphany/roleLaunch` now provide explicit bounded authority over that seam, jobs can overlay it onto live runtime `agent_jobs` progress for loaded threads, and `thread/epiphany/jobsUpdated` now translates live `agent_job_progress:{json}` background events into changed launcher-bound notifications without polling or scheduling. Freshness carries watcher-backed invalidation inputs, graphQuery traverses authoritative typed graph neighborhoods and path/symbol matches without mutation, planning projects typed captures/backlog/roadmap/objective drafts without adopting work, roles project implementation/imagination/modeling/verification/reorientation ownership from existing signals without becoming a scheduler, `roleLaunch` can launch fixed Imagination/planning, modeling/checkpoint, or verification/review specialists, `roleResult` reads those outputs back as reviewable findings without mutation, `thread/epiphany/roleAccept` can apply reviewed Imagination planning-only `statePatch` findings and reviewed modeling/checkpoint `statePatch` findings through the existing state validator, reorient turns checkpoint plus freshness/pressure/watcher signals into a read-only resume-versus-regather verdict, `thread/epiphany/reorientLaunch` is the explicit runtime consumer over that verdict, `thread/epiphany/reorientResult` reads the launched worker output back as a reviewable finding without mutation or promotion, `thread/epiphany/reorientAccept` explicitly banks completed findings into accepted observation/evidence plus optional scratch/checkpoint state, `thread/epiphany/crrc` recommends the next explicit CRRC action without launching, accepting, compacting, scheduling, or mutating, and `thread/epiphany/coordinator` composes those signals into a fixed-lane MVP action recommendation without becoming a writer.
- Native `epiphany-mvp-status` is the first dogfood operator view. It starts or reads a thread through app-server and prints scene, planning, pressure, reorient, jobs, roles, Imagination/modeling/verification role result read-backs, reorient result, heartbeat, Face bubbles, and CRRC recommendation as text or JSON. The Python status module is now compatibility tissue for still-Python coordinator/GUI drivers, not the smoked product path.
- Native `epiphany-mvp-coordinator` is the first auditable fixed-lane coordinator runner. It starts or reads a thread through app-server, follows the harness-native coordinator action, can auto-launch modeling, verification, or reorient-worker jobs, keeps semantic findings review-gated by default, and writes summary, steps, rendered snapshots, transcript, stderr, and final next-action artifacts under `.epiphany-dogfood/coordinator` or a caller-provided artifact directory. It refuses direct backend-completion mutation; full completion smoke needs live workers or a CultNet job-result API.
- Native `epiphany-mvp-coordinator` is the first auditable fixed-lane coordinator runner. It starts or reads a thread through app-server, opens a native runtime-spine session, follows the harness-native coordinator action, can auto-launch modeling, verification, or reorient-worker jobs, records native runtime job/result receipts for terminal launched work, keeps semantic findings review-gated by default, and writes summary, steps, rendered snapshots, transcript, stderr, runtime-spine status, and final next-action artifacts under `.epiphany-dogfood/coordinator` or a caller-provided artifact directory. It refuses direct backend-completion mutation; full completion smoke needs live workers while execution is being cauterized into CultNet.
- Native `epiphany-runtime-spine` is the first Codex-independent runtime vertebra. It owns typed CultCache documents for runtime identity, sessions, jobs, job results, and events; opens/completes native jobs; projects job-result counts; and can emit a framed CultNet hello message advertising the native document contract. Treat Codex app-server as a temporary evacuation bridge for launch/read-back until runtime sessions, jobs, and specialist results migrate to this spine.
- Native CRRC automation is now landed only at turn-complete safe boundaries. It may submit `Op::Compact` for coordinator-approved `compactRehydrateReorient` or for a successful pre-compaction checkpoint intervention's pending compact handoff, and it may launch the fixed `reorient-worker` for coordinator-approved `launchReorientWorker`. It does not auto-launch Imagination/modeling/verification, accept findings, promote evidence, edit implementation code, or keep going after reviewable semantic output.
- Pre-compaction checkpoint intervention is now landed. On token-count events for loaded Epiphany threads, when current context usage reaches 80% of the active auto-compact/context limit, the harness steers the active turn once with a CRRC checkpoint directive so the agent banks working context before compaction/reorientation. Pressure ignores cumulative token spend; cumulative-only telemetry reports unknown instead of yelling. A successful steer now latches a turn-scoped compact handoff that is consumed at clean turn completion, preventing the brake from decaying into another implementation turn. This is still bounded steering plus compaction handoff, not automatic semantic acceptance, a broad scheduler, or implementation continuation.

Binary file not shown.

View file

@ -107,7 +107,7 @@ accepted_design:
- `thread/epiphany/coordinator` is the first harness-native fixed-lane coordinator surface: it composes roles, pressure, reorient, CRRC, roleResult, and reorientResult into a read-only action recommendation with target role, source signals, review requirements, automation eligibility, reason, and current lane summaries without mutating state or launching work.
- Coordinator implementation clearance is stricter than review acceptance: an accepted verification/review finding only opens the implementation gate when its verdict is `pass`; accepted `needs-evidence`, `needs-review`, or `fail` findings send the loop back toward modeling/checkpoint strengthening or reorientation instead of blessing a sick machine.
- Coordinator regather handling is now fixed-lane first, not supervisor improvisation: `regatherManually` is a fallback only after reorient/modeling/verification review and launch lanes cannot advance the state, completed modeling findings must be reviewed before verification, and the CLI coordinator's explicit test-only `--auto-review` mode may accept modeling state patches before launching verification while production semantics remain review-gated.
- Native `epiphany-mvp-coordinator` is the first auditable coordinator runner: it drives the fixed single-user lanes through app-server APIs, may auto-launch modeling, verification, or reorient-worker jobs, keeps semantic findings review-gated by default, and writes coordinator summaries, JSONL steps, rendered snapshots, transcript, stderr, and final next-action artifacts. It refuses direct backend-completion mutation; full specialist completion smoke must use live workers or a proper CultNet job-result API.
- Native `epiphany-mvp-coordinator` is the first auditable coordinator runner: it drives the fixed single-user lanes through app-server APIs, opens a native runtime-spine session, records native runtime job/result receipts for launched specialists and reorient workers when terminal results arrive, keeps semantic findings review-gated by default, and writes coordinator summaries, JSONL steps, rendered snapshots, transcript, stderr, runtime-spine status, and final next-action artifacts. It refuses direct backend-completion mutation; full specialist completion smoke must use live workers while the execution path is cauterized into CultNet.
- Native `epiphany-runtime-spine` is the first Codex-independent runtime vertebra: it initializes and inspects typed CultCache `epiphany.runtime.identity`, `epiphany.runtime.session`, `epiphany.runtime.job`, `epiphany.runtime.job_result`, and `epiphany.runtime.event` documents, opens/completes native jobs with result records, and can emit a framed CultNet hello message advertising the native document contract. This is the new source-of-truth target for runtime identity/session/job/result/event state; Codex app-server is only a temporary evacuation bridge until those flows are migrated.
- Limited native CRRC automation is now wired only at turn-complete safe boundaries: it can submit a compact operation when the read-only coordinator recommends `compactRehydrateReorient` or when a successful pre-compaction checkpoint intervention left a pending compact handoff for the completed turn, and it can launch the fixed `reorient-worker` when the coordinator recommends `launchReorientWorker`. It does not auto-launch modeling or verification, auto-accept findings, promote evidence, edit implementation code, or continue after reviewable semantic results; the rite may carry the stretcher, not declare the patient healed.
- Pre-compaction checkpoint intervention is now wired at token-count boundaries: when a loaded Epiphany thread crosses the existing `shouldPrepareCompaction` pressure threshold during an active turn, the harness steers the active agent once for that turn with a bounded CRRC directive to bank scratch/checkpoint/map/evidence before compaction/reorientation. A successful steer marks a turn-scoped pending compact handoff consumed at clean turn completion; this is banking the fire before the dark, not semantic acceptance, broad scheduling, or automatic implementation continuation.

View file

@ -18,8 +18,6 @@ DEFAULT_ARTIFACT_ROOT = ROOT / ".epiphany-dogfood" / "coordinator-smoke"
def native_coordinator_exe() -> Path:
exe = Path(os.environ.get("CARGO_TARGET_DIR", r"C:\Users\Meta\.cargo-target-codex")) / "debug" / "epiphany-mvp-coordinator.exe"
if exe.exists():
return exe
subprocess.run(
[
"cargo",
@ -65,6 +63,8 @@ def run_native(
str(app_server),
"--artifact-dir",
str(artifact_dir),
"--runtime-store",
str(artifact_dir / "runtime-spine.msgpack"),
"--codex-home",
str(artifact_dir / "codex-home"),
"--cwd",
@ -100,8 +100,13 @@ def require_artifacts(summary: dict[str, Any]) -> None:
"epiphany-transcript.jsonl",
"epiphany-server.stderr.log",
"agent-function-telemetry.json",
"runtime-spine-status.json",
):
require((artifact_dir / name).exists(), f"missing coordinator artifact {name}")
require((artifact_dir / "runtime-spine.msgpack").exists(), "missing native runtime spine store")
runtime_status = json.loads((artifact_dir / "runtime-spine-status.json").read_text(encoding="utf-8"))
require(runtime_status["present"] is True, "native runtime spine should be present")
require(runtime_status["sessions"] >= 1, "native runtime spine should record a session")
def require_operator_safe(value: Any, path: str = "$") -> None: