Add operator run intent receipts

This commit is contained in:
Meta Vens 2026-05-27 21:08:55 +01:00
commit 84ed8c2865
11 changed files with 695 additions and 4 deletions

View file

@ -0,0 +1,259 @@
use anyhow::Context;
use anyhow::Result;
use chrono::Utc;
use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID;
use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION;
use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION;
use epiphany_core::EpiphanyCultMeshOperatorRunIntentEntry;
use epiphany_core::EpiphanyCultMeshOperatorRunReceiptEntry;
use epiphany_core::load_latest_epiphany_cultmesh_operator_run_intent;
use epiphany_core::load_latest_epiphany_cultmesh_operator_run_receipt;
use epiphany_core::write_epiphany_cultmesh_operator_run_intent;
use epiphany_core::write_epiphany_cultmesh_operator_run_receipt;
use serde_json::Value;
use serde_json::json;
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() -> Result<()> {
let args = Args::parse()?;
match args.command.as_str() {
"intent" => {
let intent = EpiphanyCultMeshOperatorRunIntentEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION.to_string(),
runtime_id: args.runtime_id.clone(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: args.run_id.clone(),
requested_at_utc: Utc::now().to_rfc3339(),
mode: args.mode.clone(),
root: args.root.clone(),
workspace: args.workspace.clone(),
thread_id: args.thread_id.clone(),
codex_home: args.codex_home.clone(),
target_dir: args.target_dir.clone(),
max_steps: args.max_steps,
timeout_seconds: args.timeout_seconds,
auto_review: args.auto_review,
no_ephemeral: args.no_ephemeral,
artifact_root: args.artifact_root.clone(),
dogfood_root: args.dogfood_root.clone(),
};
let written = write_epiphany_cultmesh_operator_run_intent(&args.store, intent)?;
print_json(json!({"status": "written", "store": args.store, "intent": written}))?;
}
"receipt" => {
let mut artifact_refs = Vec::new();
push_non_empty(&mut artifact_refs, &args.result_path);
push_non_empty(&mut artifact_refs, &args.artifact_root);
push_non_empty(&mut artifact_refs, &args.dogfood_root);
let receipt = EpiphanyCultMeshOperatorRunReceiptEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION.to_string(),
runtime_id: args.runtime_id.clone(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: args.run_id.clone(),
completed_at_utc: Utc::now().to_rfc3339(),
mode: args.mode.clone(),
status: args.status.clone(),
result_path: args.result_path.clone(),
artifact_root: args.artifact_root.clone(),
dogfood_root: args.dogfood_root.clone(),
operator_snapshot_store: args.operator_snapshot_store.clone(),
operator_snapshot_id: args.operator_snapshot_id.clone(),
artifact_refs,
notes: vec![
"Receipt records local operator-run completion; referenced artifacts remain evidence, not owner state.".to_string(),
"Codex app-server output is compatibility projection until the run path is native end to end.".to_string(),
],
};
let written = write_epiphany_cultmesh_operator_run_receipt(&args.store, receipt)?;
print_json(json!({"status": "written", "store": args.store, "receipt": written}))?;
}
"latest" => {
let intent =
load_latest_epiphany_cultmesh_operator_run_intent(&args.store, &args.runtime_id)?;
let receipt =
load_latest_epiphany_cultmesh_operator_run_receipt(&args.store, &args.runtime_id)?;
print_json(json!({
"status": if intent.is_some() || receipt.is_some() { "ready" } else { "missing" },
"store": args.store,
"intent": intent,
"receipt": receipt,
}))?;
}
"smoke" => {
let intent = EpiphanyCultMeshOperatorRunIntentEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION.to_string(),
runtime_id: args.runtime_id.clone(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: args.run_id.clone(),
requested_at_utc: "2026-05-27T00:00:00Z".to_string(),
mode: "status".to_string(),
root: "E:\\Projects\\EpiphanyAgent".to_string(),
workspace: "E:\\Projects\\EpiphanyAgent".to_string(),
thread_id: String::new(),
codex_home: "C:\\Users\\Meta\\.codex".to_string(),
target_dir: "C:\\Users\\Meta\\.cargo-target-codex".to_string(),
max_steps: 4,
timeout_seconds: 240,
auto_review: false,
no_ephemeral: false,
artifact_root: ".epiphany-run/local-smoke".to_string(),
dogfood_root: ".epiphany-dogfood/local-smoke".to_string(),
};
let receipt = EpiphanyCultMeshOperatorRunReceiptEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION.to_string(),
runtime_id: args.runtime_id.clone(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: args.run_id.clone(),
completed_at_utc: "2026-05-27T00:00:01Z".to_string(),
mode: "status".to_string(),
status: "completed".to_string(),
result_path: ".epiphany-run/local-smoke/status.json".to_string(),
artifact_root: ".epiphany-run/local-smoke".to_string(),
dogfood_root: ".epiphany-dogfood/local-smoke".to_string(),
operator_snapshot_store: ".epiphany-run/cultmesh/operator-snapshots.ccmp"
.to_string(),
operator_snapshot_id: "local-smoke-status".to_string(),
artifact_refs: vec![".epiphany-run/local-smoke/status.json".to_string()],
notes: vec!["smoke receipt".to_string()],
};
write_epiphany_cultmesh_operator_run_intent(&args.store, intent.clone())?;
write_epiphany_cultmesh_operator_run_receipt(&args.store, receipt.clone())?;
let latest_intent =
load_latest_epiphany_cultmesh_operator_run_intent(&args.store, &args.runtime_id)?;
let latest_receipt =
load_latest_epiphany_cultmesh_operator_run_receipt(&args.store, &args.runtime_id)?;
if latest_intent != Some(intent) || latest_receipt != Some(receipt) {
anyhow::bail!("operator run intent/receipt did not round-trip through CultMesh");
}
print_json(json!({
"status": "ok",
"store": args.store,
"runtimeId": args.runtime_id,
"runId": args.run_id,
}))?;
}
other => anyhow::bail!("unknown command {other:?}; use intent, receipt, latest, or smoke"),
}
Ok(())
}
struct Args {
command: String,
store: PathBuf,
runtime_id: String,
run_id: String,
mode: String,
root: String,
workspace: String,
thread_id: String,
codex_home: String,
target_dir: String,
max_steps: u32,
timeout_seconds: u32,
auto_review: bool,
no_ephemeral: bool,
artifact_root: String,
dogfood_root: String,
result_path: String,
status: String,
operator_snapshot_store: String,
operator_snapshot_id: String,
}
impl Args {
fn parse() -> Result<Self> {
let mut values = env::args().skip(1);
let command = values.next().unwrap_or_else(|| "latest".to_string());
let mut args = Args {
command,
store: PathBuf::from(".epiphany-run/cultmesh/operator-runs.ccmp"),
runtime_id: "epiphany-local".to_string(),
run_id: format!("run-{}", Utc::now().timestamp()),
mode: "status".to_string(),
root: String::new(),
workspace: String::new(),
thread_id: String::new(),
codex_home: String::new(),
target_dir: String::new(),
max_steps: 4,
timeout_seconds: 240,
auto_review: false,
no_ephemeral: false,
artifact_root: String::new(),
dogfood_root: String::new(),
result_path: String::new(),
status: "completed".to_string(),
operator_snapshot_store: String::new(),
operator_snapshot_id: String::new(),
};
while let Some(arg) = values.next() {
match arg.as_str() {
"--store" => args.store = PathBuf::from(next(&mut values, "--store")?),
"--runtime-id" => args.runtime_id = next(&mut values, "--runtime-id")?,
"--run-id" => args.run_id = next(&mut values, "--run-id")?,
"--mode" => args.mode = next(&mut values, "--mode")?,
"--root" => args.root = next(&mut values, "--root")?,
"--workspace" => args.workspace = next(&mut values, "--workspace")?,
"--thread-id" => args.thread_id = next(&mut values, "--thread-id")?,
"--codex-home" => args.codex_home = next(&mut values, "--codex-home")?,
"--target-dir" => args.target_dir = next(&mut values, "--target-dir")?,
"--max-steps" => args.max_steps = parse_u32(&mut values, "--max-steps")?,
"--timeout-seconds" => {
args.timeout_seconds = parse_u32(&mut values, "--timeout-seconds")?
}
"--auto-review" => args.auto_review = parse_bool(&mut values, "--auto-review")?,
"--no-ephemeral" => args.no_ephemeral = parse_bool(&mut values, "--no-ephemeral")?,
"--artifact-root" => args.artifact_root = next(&mut values, "--artifact-root")?,
"--dogfood-root" => args.dogfood_root = next(&mut values, "--dogfood-root")?,
"--result-path" => args.result_path = next(&mut values, "--result-path")?,
"--status" => args.status = next(&mut values, "--status")?,
"--operator-snapshot-store" => {
args.operator_snapshot_store = next(&mut values, "--operator-snapshot-store")?
}
"--operator-snapshot-id" => {
args.operator_snapshot_id = next(&mut values, "--operator-snapshot-id")?
}
_ => anyhow::bail!("unknown argument {arg:?}"),
}
}
if let Some(parent) = args.store.parent() {
fs::create_dir_all(parent)?;
}
Ok(args)
}
}
fn next(values: &mut impl Iterator<Item = String>, name: &str) -> Result<String> {
values
.next()
.with_context(|| format!("missing {name} value"))
}
fn parse_u32(values: &mut impl Iterator<Item = String>, name: &str) -> Result<u32> {
next(values, name)?
.parse::<u32>()
.with_context(|| format!("{name} must be a non-negative integer"))
}
fn parse_bool(values: &mut impl Iterator<Item = String>, name: &str) -> Result<bool> {
match next(values, name)?.as_str() {
"true" | "1" | "yes" => Ok(true),
"false" | "0" | "no" => Ok(false),
_ => anyhow::bail!("{name} must be true/false"),
}
}
fn push_non_empty(items: &mut Vec<String>, value: &str) {
if !value.trim().is_empty() {
items.push(value.to_string());
}
}
fn print_json(value: Value) -> Result<()> {
println!("{}", serde_json::to_string_pretty(&value)?);
Ok(())
}

View file

@ -26,6 +26,18 @@ pub const EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.operator_snapshot.v0";
pub const EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY: &str =
"epiphany-local/operator-snapshot/latest";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE: &str =
"epiphany.cultmesh.operator_run_intent";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.operator_run_intent.v0";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY: &str =
"epiphany-local/operator-run-intent/latest";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE: &str =
"epiphany.cultmesh.operator_run_receipt";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.operator_run_receipt.v0";
pub const EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY: &str =
"epiphany-local/operator-run-receipt/latest";
pub const EPIPHANY_CULTMESH_VERSE_POLICY_TYPE: &str = "epiphany.cultmesh.verse_policy";
pub const EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION: &str = "epiphany.cultmesh.verse_policy.v0";
pub const EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_TYPE: &str = "epiphany.cultmesh.global_room_policy";
@ -152,6 +164,84 @@ pub struct EpiphanyCultMeshOperatorSnapshotEntry {
pub notes: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
#[cultcache(
type = "epiphany.cultmesh.operator_run_intent",
schema = "EpiphanyCultMeshOperatorRunIntentEntry"
)]
pub struct EpiphanyCultMeshOperatorRunIntentEntry {
#[cultcache(key = 0)]
pub schema_version: String,
#[cultcache(key = 1)]
pub runtime_id: String,
#[cultcache(key = 2)]
pub verse_id: String,
#[cultcache(key = 3)]
pub run_id: String,
#[cultcache(key = 4)]
pub requested_at_utc: String,
#[cultcache(key = 5)]
pub mode: String,
#[cultcache(key = 6)]
pub root: String,
#[cultcache(key = 7)]
pub workspace: String,
#[cultcache(key = 8)]
pub thread_id: String,
#[cultcache(key = 9)]
pub codex_home: String,
#[cultcache(key = 10)]
pub target_dir: String,
#[cultcache(key = 11)]
pub max_steps: u32,
#[cultcache(key = 12)]
pub timeout_seconds: u32,
#[cultcache(key = 13)]
pub auto_review: bool,
#[cultcache(key = 14)]
pub no_ephemeral: bool,
#[cultcache(key = 15)]
pub artifact_root: String,
#[cultcache(key = 16)]
pub dogfood_root: String,
}
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
#[cultcache(
type = "epiphany.cultmesh.operator_run_receipt",
schema = "EpiphanyCultMeshOperatorRunReceiptEntry"
)]
pub struct EpiphanyCultMeshOperatorRunReceiptEntry {
#[cultcache(key = 0)]
pub schema_version: String,
#[cultcache(key = 1)]
pub runtime_id: String,
#[cultcache(key = 2)]
pub verse_id: String,
#[cultcache(key = 3)]
pub run_id: String,
#[cultcache(key = 4)]
pub completed_at_utc: String,
#[cultcache(key = 5)]
pub mode: String,
#[cultcache(key = 6)]
pub status: String,
#[cultcache(key = 7)]
pub result_path: String,
#[cultcache(key = 8)]
pub artifact_root: String,
#[cultcache(key = 9)]
pub dogfood_root: String,
#[cultcache(key = 10)]
pub operator_snapshot_store: String,
#[cultcache(key = 11)]
pub operator_snapshot_id: String,
#[cultcache(key = 12)]
pub artifact_refs: Vec<String>,
#[cultcache(key = 13)]
pub notes: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
#[cultcache(
type = "epiphany.cultmesh.verse_policy",
@ -376,6 +466,8 @@ cultmesh_documents!(EpiphanyCultMeshDocuments {
EpiphanyCultMeshStatusEntry => EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION,
EpiphanyCultMeshOperatorStatusEntry => EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION,
EpiphanyCultMeshOperatorSnapshotEntry => EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION,
EpiphanyCultMeshOperatorRunIntentEntry => EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION,
EpiphanyCultMeshOperatorRunReceiptEntry => EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION,
EpiphanyCultMeshVersePolicyEntry => EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION,
EpiphanyCultMeshGlobalRoomPolicyEntry => EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSION,
EpiphanyCultMeshMindContractEntry => EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION,
@ -549,10 +641,58 @@ pub fn load_latest_epiphany_cultmesh_operator_snapshot(
node.get(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY)
}
pub fn write_epiphany_cultmesh_operator_run_intent(
store_path: impl AsRef<Path>,
intent: EpiphanyCultMeshOperatorRunIntentEntry,
) -> Result<EpiphanyCultMeshOperatorRunIntentEntry> {
let mut node = open_epiphany_cultmesh_node(&store_path, intent.runtime_id.clone())?;
let intent_key = epiphany_cultmesh_operator_run_intent_key(&intent.run_id);
let written = node.put(intent_key.as_str(), &intent)?;
node.put(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY, &written)?;
node.flush()?;
Ok(written)
}
pub fn load_latest_epiphany_cultmesh_operator_run_intent(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
) -> Result<Option<EpiphanyCultMeshOperatorRunIntentEntry>> {
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
node.get(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY)
}
pub fn write_epiphany_cultmesh_operator_run_receipt(
store_path: impl AsRef<Path>,
receipt: EpiphanyCultMeshOperatorRunReceiptEntry,
) -> Result<EpiphanyCultMeshOperatorRunReceiptEntry> {
let mut node = open_epiphany_cultmesh_node(&store_path, receipt.runtime_id.clone())?;
let receipt_key = epiphany_cultmesh_operator_run_receipt_key(&receipt.run_id);
let written = node.put(receipt_key.as_str(), &receipt)?;
node.put(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY, &written)?;
node.flush()?;
Ok(written)
}
pub fn load_latest_epiphany_cultmesh_operator_run_receipt(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
) -> Result<Option<EpiphanyCultMeshOperatorRunReceiptEntry>> {
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
node.get(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY)
}
fn epiphany_cultmesh_operator_snapshot_key(snapshot_id: &str) -> String {
format!("epiphany-local/operator-snapshot/{snapshot_id}")
}
fn epiphany_cultmesh_operator_run_intent_key(run_id: &str) -> String {
format!("epiphany-local/operator-run-intent/{run_id}")
}
fn epiphany_cultmesh_operator_run_receipt_key(run_id: &str) -> String {
format!("epiphany-local/operator-run-receipt/{run_id}")
}
fn pointer_text(value: &Value, pointer: &str, fallback: &str) -> String {
value
.pointer(pointer)
@ -992,6 +1132,71 @@ mod tests {
Ok(())
}
#[test]
fn operator_run_intent_and_receipt_round_trip_as_native_cultmesh_documents() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("epiphany-operator-run.ccmp");
let intent = EpiphanyCultMeshOperatorRunIntentEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION.to_string(),
runtime_id: "epiphany-test".to_string(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: "run-test".to_string(),
requested_at_utc: "2026-05-27T00:00:00Z".to_string(),
mode: "status".to_string(),
root: "E:\\Projects\\EpiphanyAgent".to_string(),
workspace: "E:\\Projects\\EpiphanyAgent".to_string(),
thread_id: String::new(),
codex_home: "C:\\Users\\Meta\\.codex".to_string(),
target_dir: "C:\\Users\\Meta\\.cargo-target-codex".to_string(),
max_steps: 4,
timeout_seconds: 240,
auto_review: false,
no_ephemeral: false,
artifact_root: ".epiphany-run/run-test".to_string(),
dogfood_root: ".epiphany-dogfood/run-test".to_string(),
};
let receipt = EpiphanyCultMeshOperatorRunReceiptEntry {
schema_version: EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION.to_string(),
runtime_id: "epiphany-test".to_string(),
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
run_id: "run-test".to_string(),
completed_at_utc: "2026-05-27T00:00:01Z".to_string(),
mode: "status".to_string(),
status: "completed".to_string(),
result_path: ".epiphany-run/run-test/status.json".to_string(),
artifact_root: ".epiphany-run/run-test".to_string(),
dogfood_root: ".epiphany-dogfood/run-test".to_string(),
operator_snapshot_store: ".epiphany-run/cultmesh/operator-snapshots.ccmp".to_string(),
operator_snapshot_id: "run-test-status".to_string(),
artifact_refs: vec![".epiphany-run/run-test/status.json".to_string()],
notes: vec!["receipt".to_string()],
};
write_epiphany_cultmesh_operator_run_intent(&store, intent.clone())?;
write_epiphany_cultmesh_operator_run_receipt(&store, receipt.clone())?;
assert_eq!(
load_latest_epiphany_cultmesh_operator_run_intent(&store, "epiphany-test")?,
Some(intent)
);
assert_eq!(
load_latest_epiphany_cultmesh_operator_run_receipt(&store, "epiphany-test")?,
Some(receipt)
);
let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?;
assert!(
node.documents()
.binding(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE)
.is_some()
);
assert!(
node.documents()
.binding(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE)
.is_some()
);
Ok(())
}
#[test]
fn builtin_verse_policies_keep_public_and_private_boundaries_apart() -> Result<()> {
let temp = tempfile::tempdir()?;

View file

@ -97,6 +97,12 @@ pub use cultmesh_integration::EPIPHANY_CULTMESH_LOCAL_AREA_TIER;
pub use cultmesh_integration::EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID;
pub use cultmesh_integration::EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_MIND_CONTRACT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE;
@ -117,6 +123,8 @@ pub use cultmesh_integration::EpiphanyCultMeshGlobalRoomPolicyEntry;
pub use cultmesh_integration::EpiphanyCultMeshHandsContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshLifeContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshMindContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshOperatorRunIntentEntry;
pub use cultmesh_integration::EpiphanyCultMeshOperatorRunReceiptEntry;
pub use cultmesh_integration::EpiphanyCultMeshOperatorSnapshotEntry;
pub use cultmesh_integration::EpiphanyCultMeshOperatorStatusEntry;
pub use cultmesh_integration::EpiphanyCultMeshSoulContractEntry;
@ -135,6 +143,8 @@ pub use cultmesh_integration::epiphany_cultmesh_verse_policies;
pub use cultmesh_integration::load_epiphany_cultmesh_operator_snapshot;
pub use cultmesh_integration::load_epiphany_cultmesh_operator_status;
pub use cultmesh_integration::load_epiphany_cultmesh_status;
pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_run_intent;
pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_run_receipt;
pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_snapshot;
pub use cultmesh_integration::open_epiphany_cultmesh_node;
pub use cultmesh_integration::write_epiphany_cultmesh_body_contracts;
@ -143,6 +153,8 @@ pub use cultmesh_integration::write_epiphany_cultmesh_global_room_policies;
pub use cultmesh_integration::write_epiphany_cultmesh_hands_contracts;
pub use cultmesh_integration::write_epiphany_cultmesh_life_contracts;
pub use cultmesh_integration::write_epiphany_cultmesh_mind_contracts;
pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_intent;
pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_receipt;
pub use cultmesh_integration::write_epiphany_cultmesh_operator_snapshot;
pub use cultmesh_integration::write_epiphany_cultmesh_operator_status;
pub use cultmesh_integration::write_epiphany_cultmesh_soul_contracts;

View file

@ -12,6 +12,10 @@ use crate::body_gateway::BODY_REPO_MUTATION_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_MUTATION_RECEIPT_TYPE;
use crate::body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION;
@ -2165,6 +2169,37 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
"Raw Codex app-server JSON remains an edge artifact; this CultMesh document is the native Epiphany status receipt.",
],
),
mutation_contract(
EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE,
EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::DocumentPut,
],
CultNetMutationAuthority::LocalUser,
vec![],
vec![EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE],
vec![
"Operator run intents record explicit local wrapper requests before status/plan/smoke/run actions execute.",
"This is not a scheduler queue; it is the typed consent/trace surface for local operator action.",
],
),
mutation_contract(
EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE,
EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::DocumentPut,
CultNetDocumentOperation::ReceiptWatch,
],
CultNetMutationAuthority::LocalUser,
vec![],
vec![],
vec![
"Operator run receipts record completed local wrapper actions and evidence artifact references.",
"Referenced artifacts remain evidence; the receipt is the native completion contract.",
],
),
read_only_surface_contract(
SURFACE_SCENE_TYPE,
SCENE_SURFACE_SCHEMA_VERSION,
@ -2943,6 +2978,35 @@ mod tests {
.operations
.contains(&CultNetDocumentOperation::DocumentPut)
);
let operator_run_intent_contract = contracts
.iter()
.find(|contract| {
contract.document_type == EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE
})
.expect("operator run intent should advertise a local typed action document");
assert_eq!(
operator_run_intent_contract.authority,
CultNetMutationAuthority::LocalUser
);
assert!(
operator_run_intent_contract
.receipt_document_types
.as_ref()
.is_some_and(|items| items
.iter()
.any(|item| item == EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE))
);
let operator_run_receipt_contract = contracts
.iter()
.find(|contract| {
contract.document_type == EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE
})
.expect("operator run receipt should advertise a local typed receipt document");
assert!(
operator_run_receipt_contract
.operations
.contains(&CultNetDocumentOperation::ReceiptWatch)
);
assert!(
contracts
.iter()
@ -3085,6 +3149,16 @@ mod tests {
&& schema.schema_version.as_deref()
== Some(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION)
}));
assert!(schemas.iter().any(|schema| {
schema.document_type.as_deref() == Some(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE)
&& schema.schema_version.as_deref()
== Some(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION)
}));
assert!(schemas.iter().any(|schema| {
schema.document_type.as_deref() == Some(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_TYPE)
&& schema.schema_version.as_deref()
== Some(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION)
}));
assert!(
!schemas.iter().any(|schema| {
schema.document_type.as_deref() == Some("epiphany.surface.rider_bridge")

View file

@ -34,10 +34,11 @@ remembers doctrine; the branch remembers the blade.
- Do not copy exact branch or HEAD from this note. Run `git status --short --branch` and `git log --oneline -5`.
- The repo now has a one-command local operator path: `.\tools\epiphany_local_run.ps1`. Default mode is `smoke`; it builds the retained Codex app-server compatibility edge, builds native Epiphany operator binaries, runs the coordinator smoke, and writes launcher artifacts under `.epiphany-run/` plus coordinator artifacts under `.epiphany-dogfood/`. Use `-Mode status`, `-Mode plan`, or `-Mode run -MaxSteps 4` for the other current entrypoints; add `-ThreadId <id>` and `-Workspace <path>` to inspect or continue an existing thread. `status`, `plan`, and `smoke` do not spend model calls; `run` builds and uses `epiphany-openai-runtime`.
- 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.
- 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, and native operator snapshots round-trip through `.epiphany-smoke/cultmesh/epiphany-local.ccmp` using `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` specifically proves the operator-status document, and `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` proves the operator snapshot document. 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.
- 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.
- `notes/codex-auth-spine-inventory.md` is the source-grounded keeper list for that reliquary. Corrected compliance invariant: Codex-compatible auth identity stays anchored in vendored Codex-derived auth machinery. `epiphany-openai-auth-spine` is now a thin Epiphany-named boundary over `codex-login`, not a clean-room clone of credential storage or token refresh. Codex apps, skills, marketplace, plugin UX, broad app-server workflow, and JSON-RPC sprawl remain cuttable because they are not subscription-auth legitimacy.
- Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced.
- `notes/epiphany-swarm-readiness-plan.md` is the current live-fire direction gate. The local runner proves startup/status/coordinator wiring; it does not authorize unattended swarm operation. Carry VoidBot's lessons forward: one CTB-style initiative scheduler, typed pause/brake, active-turn freeze, cooldown after completion, stale active-turn recovery receipts, parent-side speech eligibility, memory lifecycle phases, and typed operation proposals instead of prompt-owned governance.

View file

@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-run-intent.schema.json",
"title": "Epiphany CultMesh Operator Run Intent",
"description": "CultCache tuple recording an explicit local operator-run request before the compatibility wrapper acts.",
"type": "array",
"minItems": 17,
"maxItems": 17,
"items": [
{ "title": "schemaVersion", "type": "string", "const": "epiphany.cultmesh.operator_run_intent.v0" },
{ "title": "runtimeId", "type": "string" },
{ "title": "verseId", "type": "string" },
{ "title": "runId", "type": "string" },
{ "title": "requestedAtUtc", "type": "string" },
{ "title": "mode", "type": "string" },
{ "title": "root", "type": "string" },
{ "title": "workspace", "type": "string" },
{ "title": "threadId", "type": "string" },
{ "title": "codexHome", "type": "string" },
{ "title": "targetDir", "type": "string" },
{ "title": "maxSteps", "type": "integer", "minimum": 0 },
{ "title": "timeoutSeconds", "type": "integer", "minimum": 0 },
{ "title": "autoReview", "type": "boolean" },
{ "title": "noEphemeral", "type": "boolean" },
{ "title": "artifactRoot", "type": "string" },
{ "title": "dogfoodRoot", "type": "string" }
]
}

View file

@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-run-receipt.schema.json",
"title": "Epiphany CultMesh Operator Run Receipt",
"description": "CultCache tuple recording local operator-run completion and the evidence artifacts it produced.",
"type": "array",
"minItems": 14,
"maxItems": 14,
"items": [
{ "title": "schemaVersion", "type": "string", "const": "epiphany.cultmesh.operator_run_receipt.v0" },
{ "title": "runtimeId", "type": "string" },
{ "title": "verseId", "type": "string" },
{ "title": "runId", "type": "string" },
{ "title": "completedAtUtc", "type": "string" },
{ "title": "mode", "type": "string" },
{ "title": "status", "type": "string" },
{ "title": "resultPath", "type": "string" },
{ "title": "artifactRoot", "type": "string" },
{ "title": "dogfoodRoot", "type": "string" },
{ "title": "operatorSnapshotStore", "type": "string" },
{ "title": "operatorSnapshotId", "type": "string" },
{ "title": "artifactRefs", "type": "array", "items": { "type": "string" } },
{ "title": "notes", "type": "array", "items": { "type": "string" } }
]
}

View file

@ -210,6 +210,28 @@
"title": "Epiphany CultMesh Operator Snapshot",
"path": "epiphany.cultmesh.operator-snapshot.schema.json"
},
{
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-run-intent.schema.json",
"kind": "document_payload",
"wireContracts": [
"cultnet.schema.v0"
],
"schemaVersion": "epiphany.cultmesh.operator_run_intent.v0",
"documentType": "epiphany.cultmesh.operator_run_intent",
"title": "Epiphany CultMesh Operator Run Intent",
"path": "epiphany.cultmesh.operator-run-intent.schema.json"
},
{
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-run-receipt.schema.json",
"kind": "document_payload",
"wireContracts": [
"cultnet.schema.v0"
],
"schemaVersion": "epiphany.cultmesh.operator_run_receipt.v0",
"documentType": "epiphany.cultmesh.operator_run_receipt",
"title": "Epiphany CultMesh Operator Run Receipt",
"path": "epiphany.cultmesh.operator-run-receipt.schema.json"
},
{
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.surface.scene.schema.json",
"kind": "document_payload",

Binary file not shown.

View file

@ -488,4 +488,11 @@ current_status:
status` writes the snapshot after generating the legacy JSON status
artifact. The schema describes the real CultCache tuple payload, not an
object-shaped fantasy.
next_action: Continue Codex starvation and CultNet liberation by moving the next live operator action from compatibility artifacts into typed CultNet intent/receipt documents. The strongest target is a local-run/coordinator intent and completion receipt, keeping Codex app-server JSON-RPC as compatibility projection only.
Local operator runs now have typed intent/receipt rails too:
`epiphany-operator-run` writes
`epiphany.cultmesh.operator_run_intent.v0` before the local wrapper acts
and `epiphany.cultmesh.operator_run_receipt.v0` after successful
completion; `tools/epiphany_local_run.ps1 -Mode status` now writes intent,
legacy status artifact, operator snapshot, and completion receipt in that
order.
next_action: Continue Codex starvation and CultNet liberation by moving coordinator plan/run outputs into typed CultNet receipts and by reducing the local wrapper's dependence on Codex app-server JSON-RPC projections for facts Epiphany already owns natively.

View file

@ -74,11 +74,14 @@ New-Item -ItemType Directory -Force -Path $dogfoodRoot | Out-Null
$codexAppServer = Join-Path $TargetDir "debug\codex-app-server.exe"
$statusExe = Join-Path $TargetDir "debug\epiphany-mvp-status.exe"
$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"
$operatorRunStore = Join-Path $Root ".epiphany-run\cultmesh\operator-runs.ccmp"
$operatorSnapshotStore = Join-Path $Root ".epiphany-run\cultmesh\operator-snapshots.ccmp"
$operatorSnapshotId = "$runId-status"
if (-not $SkipBuild) {
Invoke-Checked `
@ -96,6 +99,7 @@ if (-not $SkipBuild) {
"build",
"--manifest-path", ".\epiphany-core\Cargo.toml",
"--bin", "epiphany-mvp-status",
"--bin", "epiphany-operator-run",
"--bin", "epiphany-operator-snapshot",
"--bin", "epiphany-mvp-coordinator",
"--bin", "epiphany-mvp-coordinator-smoke",
@ -118,7 +122,7 @@ if (-not $SkipBuild) {
}
}
foreach ($required in @($codexAppServer, $statusExe, $operatorSnapshotExe, $coordinatorExe)) {
foreach ($required in @($codexAppServer, $statusExe, $operatorRunExe, $operatorSnapshotExe, $coordinatorExe)) {
if (-not (Test-Path -LiteralPath $required)) {
throw "required binary not found: $required"
}
@ -130,6 +134,36 @@ if ($NoEphemeral) {
}
$resultPath = ""
$autoReviewValue = $AutoReview.IsPresent.ToString().ToLowerInvariant()
$noEphemeralValue = $NoEphemeral.IsPresent.ToString().ToLowerInvariant()
$operatorRunIntentArgs = @(
"intent",
"--store", $operatorRunStore,
"--runtime-id", "epiphany-local",
"--run-id", $runId,
"--mode", $Mode,
"--root", $Root,
"--workspace", $Workspace,
"--codex-home", $CodexHome,
"--target-dir", $TargetDir,
"--max-steps", "$MaxSteps",
"--timeout-seconds", "$TimeoutSeconds",
"--auto-review", $autoReviewValue,
"--no-ephemeral", $noEphemeralValue,
"--artifact-root", $artifactRoot,
"--dogfood-root", $dogfoodRoot
)
if ($ThreadId -ne "") {
$operatorRunIntentArgs += @("--thread-id", $ThreadId)
}
Invoke-Checked `
-Label "write CultMesh operator run intent" `
-FilePath $operatorRunExe `
-Arguments $operatorRunIntentArgs `
-WorkingDirectory $Root `
-StdoutPath (Join-Path $artifactRoot "operator-run-intent.stdout.json") `
-StderrPath (Join-Path $artifactRoot "operator-run-intent.stderr.log")
if ($Mode -eq "status") {
$statusJson = Join-Path $artifactRoot "status.json"
@ -161,7 +195,7 @@ if ($Mode -eq "status") {
"from-status",
"--store", $operatorSnapshotStore,
"--runtime-id", "epiphany-local",
"--snapshot-id", "$runId-status",
"--snapshot-id", $operatorSnapshotId,
"--source-mode", "status",
"--input", $statusJson
) `
@ -256,6 +290,8 @@ $summary = @"
- dogfoodRoot: $dogfoodRoot
- codexAppServer: $codexAppServer
- statusBinary: $statusExe
- operatorRunBinary: $operatorRunExe
- operatorRunStore: $operatorRunStore
- operatorSnapshotBinary: $operatorSnapshotExe
- operatorSnapshotStore: $operatorSnapshotStore
- coordinatorBinary: $coordinatorExe
@ -283,6 +319,28 @@ if ($resultPath -ne "" -and (Test-Path -LiteralPath $resultPath)) {
Write-Host "Summary parse failed; inspect $resultPath"
}
}
$operatorRunReceiptArgs = @(
"receipt",
"--store", $operatorRunStore,
"--runtime-id", "epiphany-local",
"--run-id", $runId,
"--mode", $Mode,
"--status", "completed",
"--result-path", $resultPath,
"--artifact-root", $artifactRoot,
"--dogfood-root", $dogfoodRoot,
"--operator-snapshot-store", $operatorSnapshotStore
)
if ($Mode -eq "status") {
$operatorRunReceiptArgs += @("--operator-snapshot-id", $operatorSnapshotId)
}
Invoke-Checked `
-Label "write CultMesh operator run receipt" `
-FilePath $operatorRunExe `
-Arguments $operatorRunReceiptArgs `
-WorkingDirectory $Root `
-StdoutPath (Join-Path $artifactRoot "operator-run-receipt.stdout.json") `
-StderrPath (Join-Path $artifactRoot "operator-run-receipt.stderr.log")
Write-Host "Epiphany local run complete."
Write-Host "Launcher artifacts: $artifactRoot"
Write-Host "Coordinator artifacts: $dogfoodRoot"