Add native operator snapshots
This commit is contained in:
parent
f476f17223
commit
3abd6803a4
14 changed files with 672 additions and 39 deletions
|
|
@ -269,6 +269,12 @@ pub fn load_completed_core_epiphany_role_finding(
|
|||
snapshot.status
|
||||
)));
|
||||
}
|
||||
let runtime_store_path = runtime_store_path.ok_or_else(|| {
|
||||
EpiphanyBridgeError::InvalidRequest(
|
||||
"cannot accept completed role worker without a loaded runtime-spine store"
|
||||
.to_string(),
|
||||
)
|
||||
})?;
|
||||
require_launch_organ_contract(runtime_store_path, link.runtime_job_id.as_str(), "role")?;
|
||||
return snapshot.finding.ok_or_else(|| {
|
||||
EpiphanyBridgeError::InvalidRequest(
|
||||
|
|
@ -348,6 +354,12 @@ pub fn load_completed_core_epiphany_reorient_finding(
|
|||
snapshot.status
|
||||
)));
|
||||
}
|
||||
let runtime_store_path = runtime_store_path.ok_or_else(|| {
|
||||
EpiphanyBridgeError::InvalidRequest(
|
||||
"cannot accept completed reorientation worker without a loaded runtime-spine store"
|
||||
.to_string(),
|
||||
)
|
||||
})?;
|
||||
require_launch_organ_contract(
|
||||
runtime_store_path,
|
||||
link.runtime_job_id.as_str(),
|
||||
|
|
|
|||
|
|
@ -4,14 +4,17 @@ use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID;
|
|||
use epiphany_core::EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION;
|
||||
use epiphany_core::EpiphanyCultMeshStatusEntry;
|
||||
use epiphany_core::default_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json;
|
||||
use epiphany_core::load_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::load_epiphany_cultmesh_status;
|
||||
use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot;
|
||||
use epiphany_core::write_epiphany_cultmesh_body_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_eyes_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_global_room_policies;
|
||||
use epiphany_core::write_epiphany_cultmesh_hands_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_life_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_mind_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_snapshot;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_status;
|
||||
use epiphany_core::write_epiphany_cultmesh_soul_contracts;
|
||||
use epiphany_core::write_epiphany_cultmesh_status;
|
||||
|
|
@ -47,6 +50,42 @@ fn main() -> Result<()> {
|
|||
"2026-05-27T00:00:00Z",
|
||||
);
|
||||
write_epiphany_cultmesh_operator_status(&store, operator_status.clone())?;
|
||||
let operator_snapshot = epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
"epiphany-cultmesh-smoke",
|
||||
"cultmesh-smoke-status",
|
||||
"2026-05-27T00:00:00Z",
|
||||
"status",
|
||||
".epiphany-smoke/cultmesh/status.json",
|
||||
&serde_json::json!({
|
||||
"threadId": "thread-smoke",
|
||||
"scene": {
|
||||
"scene": {
|
||||
"stateStatus": "missing",
|
||||
"availableActions": ["crrc", "roles"]
|
||||
}
|
||||
},
|
||||
"pressure": {
|
||||
"pressure": {
|
||||
"level": "low"
|
||||
}
|
||||
},
|
||||
"reorient": {
|
||||
"decision": {
|
||||
"action": "regather",
|
||||
"nextAction": "Regather source context."
|
||||
}
|
||||
},
|
||||
"crrc": {
|
||||
"recommendation": {
|
||||
"action": "regatherManually"
|
||||
}
|
||||
},
|
||||
"coordinator": {
|
||||
"action": "wait"
|
||||
}
|
||||
}),
|
||||
)?;
|
||||
write_epiphany_cultmesh_operator_snapshot(&store, operator_snapshot.clone())?;
|
||||
let loaded = load_epiphany_cultmesh_status(&store, "epiphany-cultmesh-smoke")?;
|
||||
if loaded != Some(status) {
|
||||
anyhow::bail!("CultMesh smoke failed to round-trip Epiphany status document");
|
||||
|
|
@ -56,6 +95,11 @@ fn main() -> Result<()> {
|
|||
if loaded_operator_status != Some(operator_status) {
|
||||
anyhow::bail!("CultMesh smoke failed to round-trip Epiphany operator status document");
|
||||
}
|
||||
let loaded_operator_snapshot =
|
||||
load_latest_epiphany_cultmesh_operator_snapshot(&store, "epiphany-cultmesh-smoke")?;
|
||||
if loaded_operator_snapshot != Some(operator_snapshot) {
|
||||
anyhow::bail!("CultMesh smoke failed to round-trip Epiphany operator snapshot document");
|
||||
}
|
||||
|
||||
println!(
|
||||
"epiphany cultmesh smoke ok: {}",
|
||||
|
|
|
|||
164
epiphany-core/src/bin/epiphany-operator-snapshot.rs
Normal file
164
epiphany-core/src/bin/epiphany-operator-snapshot.rs
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
use anyhow::Context;
|
||||
use anyhow::Result;
|
||||
use chrono::Utc;
|
||||
use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json;
|
||||
use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot;
|
||||
use epiphany_core::write_epiphany_cultmesh_operator_snapshot;
|
||||
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() {
|
||||
"from-status" => {
|
||||
let input = args.input.context("from-status requires --input")?;
|
||||
let source = fs::read_to_string(&input)
|
||||
.with_context(|| format!("failed to read {}", input.display()))?;
|
||||
let status_json: Value = serde_json::from_str(&source)
|
||||
.with_context(|| format!("failed to parse {}", input.display()))?;
|
||||
let snapshot = epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
args.runtime_id.clone(),
|
||||
args.snapshot_id.clone(),
|
||||
Utc::now().to_rfc3339(),
|
||||
args.source_mode.clone(),
|
||||
input.to_string_lossy(),
|
||||
&status_json,
|
||||
)?;
|
||||
let written = write_epiphany_cultmesh_operator_snapshot(&args.store, snapshot)?;
|
||||
print_json(json!({
|
||||
"status": "written",
|
||||
"store": args.store,
|
||||
"snapshot": written,
|
||||
}))?;
|
||||
}
|
||||
"latest" => {
|
||||
let latest =
|
||||
load_latest_epiphany_cultmesh_operator_snapshot(&args.store, &args.runtime_id)?;
|
||||
print_json(json!({
|
||||
"status": if latest.is_some() { "ready" } else { "missing" },
|
||||
"store": args.store,
|
||||
"snapshot": latest,
|
||||
}))?;
|
||||
}
|
||||
"smoke" => {
|
||||
let status_json = json!({
|
||||
"threadId": "thread-smoke",
|
||||
"scene": {
|
||||
"scene": {
|
||||
"stateStatus": "missing",
|
||||
"availableActions": ["crrc", "roles"]
|
||||
}
|
||||
},
|
||||
"pressure": {
|
||||
"pressure": {
|
||||
"level": "low"
|
||||
}
|
||||
},
|
||||
"reorient": {
|
||||
"decision": {
|
||||
"action": "regather",
|
||||
"nextAction": "Regather source context."
|
||||
}
|
||||
},
|
||||
"crrc": {
|
||||
"recommendation": {
|
||||
"action": "regatherManually"
|
||||
}
|
||||
},
|
||||
"coordinator": {
|
||||
"action": "wait"
|
||||
},
|
||||
"rawResult": {
|
||||
"sealed": true
|
||||
}
|
||||
});
|
||||
let snapshot = epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
args.runtime_id.clone(),
|
||||
args.snapshot_id.clone(),
|
||||
"2026-05-27T00:00:00Z",
|
||||
"status",
|
||||
".epiphany-smoke/operator-status.json",
|
||||
&status_json,
|
||||
)?;
|
||||
write_epiphany_cultmesh_operator_snapshot(&args.store, snapshot.clone())?;
|
||||
let latest =
|
||||
load_latest_epiphany_cultmesh_operator_snapshot(&args.store, &args.runtime_id)?;
|
||||
if latest != Some(snapshot) {
|
||||
anyhow::bail!("operator snapshot did not round-trip through CultMesh");
|
||||
}
|
||||
print_json(json!({
|
||||
"status": "ok",
|
||||
"store": args.store,
|
||||
"runtimeId": args.runtime_id,
|
||||
"snapshotId": args.snapshot_id,
|
||||
}))?;
|
||||
}
|
||||
other => anyhow::bail!("unknown command {other:?}; use from-status, latest, or smoke"),
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
struct Args {
|
||||
command: String,
|
||||
store: PathBuf,
|
||||
runtime_id: String,
|
||||
snapshot_id: String,
|
||||
source_mode: String,
|
||||
input: Option<PathBuf>,
|
||||
}
|
||||
|
||||
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 store = PathBuf::from(".epiphany-run/cultmesh/operator-snapshots.ccmp");
|
||||
let mut runtime_id = "epiphany-local".to_string();
|
||||
let mut snapshot_id = format!("snapshot-{}", Utc::now().timestamp());
|
||||
let mut source_mode = "status".to_string();
|
||||
let mut input = None;
|
||||
|
||||
while let Some(arg) = values.next() {
|
||||
match arg.as_str() {
|
||||
"--store" => {
|
||||
store = PathBuf::from(values.next().context("missing --store value")?);
|
||||
}
|
||||
"--runtime-id" => {
|
||||
runtime_id = values.next().context("missing --runtime-id value")?;
|
||||
}
|
||||
"--snapshot-id" => {
|
||||
snapshot_id = values.next().context("missing --snapshot-id value")?;
|
||||
}
|
||||
"--source-mode" => {
|
||||
source_mode = values.next().context("missing --source-mode value")?;
|
||||
}
|
||||
"--input" => {
|
||||
input = Some(PathBuf::from(
|
||||
values.next().context("missing --input value")?,
|
||||
));
|
||||
}
|
||||
_ => anyhow::bail!("unknown argument {arg:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(parent) = store.parent() {
|
||||
fs::create_dir_all(parent)?;
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
command,
|
||||
store,
|
||||
runtime_id,
|
||||
snapshot_id,
|
||||
source_mode,
|
||||
input,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn print_json(value: Value) -> Result<()> {
|
||||
println!("{}", serde_json::to_string_pretty(&value)?);
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -5,11 +5,13 @@ use crate::default_life_cultnet_contracts;
|
|||
use crate::default_mind_cultnet_contracts;
|
||||
use crate::default_soul_cultnet_contracts;
|
||||
use anyhow::Result;
|
||||
use anyhow::anyhow;
|
||||
use cultcache_rs::DatabaseEntry;
|
||||
use cultmesh_rs::CultMesh;
|
||||
use cultmesh_rs::CultMeshNode;
|
||||
use cultmesh_rs::CultMeshNodeOptions;
|
||||
use cultmesh_rs::cultmesh_documents;
|
||||
use serde_json::Value;
|
||||
use std::path::Path;
|
||||
|
||||
pub const EPIPHANY_CULTMESH_STATUS_TYPE: &str = "epiphany.cultmesh.status";
|
||||
|
|
@ -19,6 +21,11 @@ pub const EPIPHANY_CULTMESH_OPERATOR_STATUS_TYPE: &str = "epiphany.cultmesh.oper
|
|||
pub const EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION: &str =
|
||||
"epiphany.cultmesh.operator_status.v0";
|
||||
pub const EPIPHANY_CULTMESH_OPERATOR_STATUS_KEY: &str = "epiphany-local/operator-status";
|
||||
pub const EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE: &str = "epiphany.cultmesh.operator_snapshot";
|
||||
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_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";
|
||||
|
|
@ -101,6 +108,50 @@ pub struct EpiphanyCultMeshOperatorStatusEntry {
|
|||
pub quarantined_surfaces: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.cultmesh.operator_snapshot",
|
||||
schema = "EpiphanyCultMeshOperatorSnapshotEntry"
|
||||
)]
|
||||
pub struct EpiphanyCultMeshOperatorSnapshotEntry {
|
||||
#[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 snapshot_id: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub generated_at_utc: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub source_mode: String,
|
||||
#[cultcache(key = 6)]
|
||||
pub source_path: String,
|
||||
#[cultcache(key = 7)]
|
||||
pub thread_id: String,
|
||||
#[cultcache(key = 8)]
|
||||
pub status: String,
|
||||
#[cultcache(key = 9)]
|
||||
pub state_status: String,
|
||||
#[cultcache(key = 10)]
|
||||
pub coordinator_action: String,
|
||||
#[cultcache(key = 11)]
|
||||
pub crrc_action: String,
|
||||
#[cultcache(key = 12)]
|
||||
pub pressure_level: String,
|
||||
#[cultcache(key = 13)]
|
||||
pub reorient_action: String,
|
||||
#[cultcache(key = 14)]
|
||||
pub next_action: String,
|
||||
#[cultcache(key = 15)]
|
||||
pub artifact_refs: Vec<String>,
|
||||
#[cultcache(key = 16)]
|
||||
pub available_actions: Vec<String>,
|
||||
#[cultcache(key = 17)]
|
||||
pub notes: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.cultmesh.verse_policy",
|
||||
|
|
@ -324,6 +375,7 @@ pub struct EpiphanyCultMeshLifeContractEntry {
|
|||
cultmesh_documents!(EpiphanyCultMeshDocuments {
|
||||
EpiphanyCultMeshStatusEntry => EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION,
|
||||
EpiphanyCultMeshOperatorStatusEntry => EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION,
|
||||
EpiphanyCultMeshOperatorSnapshotEntry => EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION,
|
||||
EpiphanyCultMeshVersePolicyEntry => EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION,
|
||||
EpiphanyCultMeshGlobalRoomPolicyEntry => EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSION,
|
||||
EpiphanyCultMeshMindContractEntry => EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION,
|
||||
|
|
@ -420,6 +472,113 @@ pub fn load_epiphany_cultmesh_operator_status(
|
|||
node.get(EPIPHANY_CULTMESH_OPERATOR_STATUS_KEY)
|
||||
}
|
||||
|
||||
pub fn epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
runtime_id: impl Into<String>,
|
||||
snapshot_id: impl Into<String>,
|
||||
generated_at_utc: impl Into<String>,
|
||||
source_mode: impl Into<String>,
|
||||
source_path: impl Into<String>,
|
||||
status_json: &Value,
|
||||
) -> Result<EpiphanyCultMeshOperatorSnapshotEntry> {
|
||||
let source_path = source_path.into();
|
||||
let state_status = pointer_text(status_json, "/scene/scene/stateStatus", "unknown");
|
||||
let crrc_action = pointer_text(status_json, "/crrc/recommendation/action", "unknown");
|
||||
let reorient_action = pointer_text(status_json, "/reorient/decision/action", "unknown");
|
||||
let operator_status = if state_status == "missing" || crrc_action == "regatherManually" {
|
||||
"needs-regather"
|
||||
} else {
|
||||
"ready"
|
||||
};
|
||||
let mut artifact_refs = Vec::new();
|
||||
if !source_path.trim().is_empty() {
|
||||
artifact_refs.push(source_path.clone());
|
||||
}
|
||||
|
||||
Ok(EpiphanyCultMeshOperatorSnapshotEntry {
|
||||
schema_version: EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION.to_string(),
|
||||
runtime_id: runtime_id.into(),
|
||||
verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(),
|
||||
snapshot_id: snapshot_id.into(),
|
||||
generated_at_utc: generated_at_utc.into(),
|
||||
source_mode: source_mode.into(),
|
||||
source_path,
|
||||
thread_id: pointer_text(status_json, "/threadId", "missing"),
|
||||
status: operator_status.to_string(),
|
||||
state_status,
|
||||
coordinator_action: pointer_text(status_json, "/coordinator/action", "none"),
|
||||
crrc_action,
|
||||
pressure_level: pointer_text(status_json, "/pressure/pressure/level", "unknown"),
|
||||
reorient_action,
|
||||
next_action: pointer_text(status_json, "/reorient/decision/nextAction", "none"),
|
||||
artifact_refs,
|
||||
available_actions: pointer_string_array(status_json, "/scene/scene/availableActions")?,
|
||||
notes: vec![
|
||||
"Snapshot is derived from the operator-safe MVP status artifact; raw JSON remains an edge artifact, not internal state.".to_string(),
|
||||
"Codex app-server remains compatibility transport for this source until the status surface is native end to end.".to_string(),
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
pub fn write_epiphany_cultmesh_operator_snapshot(
|
||||
store_path: impl AsRef<Path>,
|
||||
snapshot: EpiphanyCultMeshOperatorSnapshotEntry,
|
||||
) -> Result<EpiphanyCultMeshOperatorSnapshotEntry> {
|
||||
let mut node = open_epiphany_cultmesh_node(&store_path, snapshot.runtime_id.clone())?;
|
||||
let snapshot_key = epiphany_cultmesh_operator_snapshot_key(&snapshot.snapshot_id);
|
||||
let written = node.put(snapshot_key.as_str(), &snapshot)?;
|
||||
node.put(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY, &written)?;
|
||||
node.flush()?;
|
||||
Ok(written)
|
||||
}
|
||||
|
||||
pub fn load_epiphany_cultmesh_operator_snapshot(
|
||||
store_path: impl AsRef<Path>,
|
||||
runtime_id: impl Into<String>,
|
||||
snapshot_id: impl AsRef<str>,
|
||||
) -> Result<Option<EpiphanyCultMeshOperatorSnapshotEntry>> {
|
||||
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
|
||||
let snapshot_key = epiphany_cultmesh_operator_snapshot_key(snapshot_id.as_ref());
|
||||
node.get(snapshot_key.as_str())
|
||||
}
|
||||
|
||||
pub fn load_latest_epiphany_cultmesh_operator_snapshot(
|
||||
store_path: impl AsRef<Path>,
|
||||
runtime_id: impl Into<String>,
|
||||
) -> Result<Option<EpiphanyCultMeshOperatorSnapshotEntry>> {
|
||||
let node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
|
||||
node.get(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY)
|
||||
}
|
||||
|
||||
fn epiphany_cultmesh_operator_snapshot_key(snapshot_id: &str) -> String {
|
||||
format!("epiphany-local/operator-snapshot/{snapshot_id}")
|
||||
}
|
||||
|
||||
fn pointer_text(value: &Value, pointer: &str, fallback: &str) -> String {
|
||||
value
|
||||
.pointer(pointer)
|
||||
.and_then(Value::as_str)
|
||||
.filter(|text| !text.trim().is_empty())
|
||||
.unwrap_or(fallback)
|
||||
.to_string()
|
||||
}
|
||||
|
||||
fn pointer_string_array(value: &Value, pointer: &str) -> Result<Vec<String>> {
|
||||
let Some(items) = value.pointer(pointer) else {
|
||||
return Ok(Vec::new());
|
||||
};
|
||||
let items = items
|
||||
.as_array()
|
||||
.ok_or_else(|| anyhow!("{pointer} must be an array when present"))?;
|
||||
items
|
||||
.iter()
|
||||
.map(|item| {
|
||||
item.as_str()
|
||||
.map(ToString::to_string)
|
||||
.ok_or_else(|| anyhow!("{pointer} must contain only strings"))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn epiphany_cultmesh_verse_policies() -> Vec<EpiphanyCultMeshVersePolicyEntry> {
|
||||
vec![
|
||||
EpiphanyCultMeshVersePolicyEntry {
|
||||
|
|
@ -766,6 +925,73 @@ mod tests {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn operator_snapshot_distills_status_json_into_typed_cultmesh_document() -> Result<()> {
|
||||
let temp = tempfile::tempdir()?;
|
||||
let store = temp.path().join("epiphany-operator-snapshot.ccmp");
|
||||
let status_json = serde_json::json!({
|
||||
"threadId": "thread-test",
|
||||
"scene": {
|
||||
"scene": {
|
||||
"stateStatus": "missing",
|
||||
"availableActions": ["crrc", "roles"]
|
||||
}
|
||||
},
|
||||
"pressure": {
|
||||
"pressure": {
|
||||
"level": "low"
|
||||
}
|
||||
},
|
||||
"reorient": {
|
||||
"decision": {
|
||||
"action": "regather",
|
||||
"nextAction": "Regather source context."
|
||||
}
|
||||
},
|
||||
"crrc": {
|
||||
"recommendation": {
|
||||
"action": "regatherManually"
|
||||
}
|
||||
},
|
||||
"coordinator": {
|
||||
"action": "wait"
|
||||
},
|
||||
"rawResult": {
|
||||
"sealed": true
|
||||
}
|
||||
});
|
||||
let snapshot = epiphany_cultmesh_operator_snapshot_from_status_json(
|
||||
"epiphany-test",
|
||||
"snapshot-test",
|
||||
"2026-05-27T00:00:00Z",
|
||||
"status",
|
||||
".epiphany-run/status.json",
|
||||
&status_json,
|
||||
)?;
|
||||
|
||||
assert_eq!(snapshot.status, "needs-regather");
|
||||
assert_eq!(snapshot.thread_id, "thread-test");
|
||||
assert_eq!(snapshot.available_actions, vec!["crrc", "roles"]);
|
||||
assert_eq!(snapshot.artifact_refs, vec![".epiphany-run/status.json"]);
|
||||
|
||||
write_epiphany_cultmesh_operator_snapshot(&store, snapshot.clone())?;
|
||||
assert_eq!(
|
||||
load_epiphany_cultmesh_operator_snapshot(&store, "epiphany-test", "snapshot-test")?,
|
||||
Some(snapshot.clone())
|
||||
);
|
||||
assert_eq!(
|
||||
load_latest_epiphany_cultmesh_operator_snapshot(&store, "epiphany-test")?,
|
||||
Some(snapshot)
|
||||
);
|
||||
let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?;
|
||||
assert!(
|
||||
node.documents()
|
||||
.binding(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE)
|
||||
.is_some()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn builtin_verse_policies_keep_public_and_private_boundaries_apart() -> Result<()> {
|
||||
let temp = tempfile::tempdir()?;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@ 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_SNAPSHOT_LATEST_KEY;
|
||||
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION;
|
||||
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE;
|
||||
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_KEY;
|
||||
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION;
|
||||
pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_TYPE;
|
||||
|
|
@ -114,6 +117,7 @@ pub use cultmesh_integration::EpiphanyCultMeshGlobalRoomPolicyEntry;
|
|||
pub use cultmesh_integration::EpiphanyCultMeshHandsContractEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshLifeContractEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshMindContractEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshOperatorSnapshotEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshOperatorStatusEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshSoulContractEntry;
|
||||
pub use cultmesh_integration::EpiphanyCultMeshStatusEntry;
|
||||
|
|
@ -125,10 +129,13 @@ pub use cultmesh_integration::epiphany_cultmesh_global_room_policies;
|
|||
pub use cultmesh_integration::epiphany_cultmesh_hands_contracts;
|
||||
pub use cultmesh_integration::epiphany_cultmesh_life_contracts;
|
||||
pub use cultmesh_integration::epiphany_cultmesh_mind_contracts;
|
||||
pub use cultmesh_integration::epiphany_cultmesh_operator_snapshot_from_status_json;
|
||||
pub use cultmesh_integration::epiphany_cultmesh_soul_contracts;
|
||||
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_snapshot;
|
||||
pub use cultmesh_integration::open_epiphany_cultmesh_node;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_body_contracts;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_eyes_contracts;
|
||||
|
|
@ -136,6 +143,7 @@ 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_snapshot;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_operator_status;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_soul_contracts;
|
||||
pub use cultmesh_integration::write_epiphany_cultmesh_status;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ 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_SNAPSHOT_SCHEMA_VERSION;
|
||||
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE;
|
||||
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION;
|
||||
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_STATUS_TYPE;
|
||||
use crate::eyes_gateway::EYES_EVIDENCE_PACKET_SCHEMA_VERSION;
|
||||
|
|
@ -2148,6 +2150,21 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
|
|||
"This surface names the Codex bridge role, Epiphany authority role, prompt-authority boundary, and quarantined optional bridges.",
|
||||
],
|
||||
),
|
||||
mutation_contract(
|
||||
EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE,
|
||||
EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION,
|
||||
vec![
|
||||
CultNetDocumentOperation::Snapshot,
|
||||
CultNetDocumentOperation::DocumentPut,
|
||||
],
|
||||
CultNetMutationAuthority::LocalUser,
|
||||
vec![],
|
||||
vec![],
|
||||
vec![
|
||||
"Operator snapshots are bounded typed receipts derived from operator-safe status/run artifacts.",
|
||||
"Raw Codex app-server JSON remains an edge artifact; this CultMesh document is the native Epiphany status receipt.",
|
||||
],
|
||||
),
|
||||
read_only_surface_contract(
|
||||
SURFACE_SCENE_TYPE,
|
||||
SCENE_SURFACE_SCHEMA_VERSION,
|
||||
|
|
@ -2911,6 +2928,21 @@ mod tests {
|
|||
.any(|note| note.contains("Codex app-server status is bridge"))
|
||||
})
|
||||
);
|
||||
let operator_snapshot_contract = contracts
|
||||
.iter()
|
||||
.find(|contract| {
|
||||
contract.document_type == EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE
|
||||
})
|
||||
.expect("operator snapshot should advertise a local typed receipt document");
|
||||
assert_eq!(
|
||||
operator_snapshot_contract.authority,
|
||||
CultNetMutationAuthority::LocalUser
|
||||
);
|
||||
assert!(
|
||||
operator_snapshot_contract
|
||||
.operations
|
||||
.contains(&CultNetDocumentOperation::DocumentPut)
|
||||
);
|
||||
assert!(
|
||||
contracts
|
||||
.iter()
|
||||
|
|
@ -3048,6 +3080,11 @@ mod tests {
|
|||
&& schema.schema_version.as_deref()
|
||||
== Some(EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION)
|
||||
}));
|
||||
assert!(schemas.iter().any(|schema| {
|
||||
schema.document_type.as_deref() == Some(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_TYPE)
|
||||
&& schema.schema_version.as_deref()
|
||||
== Some(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_SCHEMA_VERSION)
|
||||
}));
|
||||
assert!(
|
||||
!schemas.iter().any(|schema| {
|
||||
schema.document_type.as_deref() == Some("epiphany.surface.rider_bridge")
|
||||
|
|
|
|||
|
|
@ -34,9 +34,10 @@ 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`.
|
||||
- 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, and native operator status 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. 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, 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.
|
||||
- `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.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-snapshot.schema.json",
|
||||
"title": "Epiphany CultMesh Operator Snapshot",
|
||||
"description": "Bounded typed CultCache tuple distilled from an operator-safe run/status artifact. Raw Codex app-server JSON remains an edge artifact; this document is the native Epiphany receipt.",
|
||||
"type": "array",
|
||||
"minItems": 18,
|
||||
"maxItems": 18,
|
||||
"items": [
|
||||
{
|
||||
"title": "schemaVersion",
|
||||
"type": "string",
|
||||
"const": "epiphany.cultmesh.operator_snapshot.v0"
|
||||
},
|
||||
{
|
||||
"title": "runtimeId",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "verseId",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "snapshotId",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "generatedAtUtc",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "sourceMode",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "sourcePath",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "threadId",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "status",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "stateStatus",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "coordinatorAction",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "crrcAction",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "pressureLevel",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "reorientAction",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "nextAction",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"title": "artifactRefs",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "availableActions",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "notes",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -2,67 +2,65 @@
|
|||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-status.schema.json",
|
||||
"title": "Epiphany CultMesh Operator Status",
|
||||
"description": "Native operator-status document naming the Codex bridge role, Epiphany authority role, prompt boundary, and quarantined optional bridge surfaces.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"schemaVersion": {
|
||||
"description": "Native operator-status CultCache tuple naming the Codex bridge role, Epiphany authority role, prompt boundary, and quarantined optional bridge surfaces.",
|
||||
"type": "array",
|
||||
"minItems": 12,
|
||||
"maxItems": 12,
|
||||
"items": [
|
||||
{
|
||||
"title": "schemaVersion",
|
||||
"type": "string",
|
||||
"const": "epiphany.cultmesh.operator_status.v0"
|
||||
},
|
||||
"runtimeId": {
|
||||
{
|
||||
"title": "runtimeId",
|
||||
"type": "string"
|
||||
},
|
||||
"verseId": {
|
||||
{
|
||||
"title": "verseId",
|
||||
"type": "string"
|
||||
},
|
||||
"surfaceId": {
|
||||
{
|
||||
"title": "surfaceId",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
{
|
||||
"title": "status",
|
||||
"type": "string"
|
||||
},
|
||||
"generatedAtUtc": {
|
||||
{
|
||||
"title": "generatedAtUtc",
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
{
|
||||
"title": "summary",
|
||||
"type": "string"
|
||||
},
|
||||
"codexBridgeRole": {
|
||||
"type": "string",
|
||||
"description": "What Codex may do for this Epiphany instance: bridge OpenAI/model transport, streaming, and Codex-native app-server affordances."
|
||||
{
|
||||
"title": "codexBridgeRole",
|
||||
"type": "string"
|
||||
},
|
||||
"epiphanyAuthorityRole": {
|
||||
"type": "string",
|
||||
"description": "What Epiphany owns: state, processes, prompts, scheduler decisions, organ contracts, and mutation law."
|
||||
{
|
||||
"title": "epiphanyAuthorityRole",
|
||||
"type": "string"
|
||||
},
|
||||
"promptAuthority": {
|
||||
"type": "string",
|
||||
"description": "Boundary forbidding Codex prompt machinery from injecting doctrine, role instructions, state law, or coordinator policy into Epiphany agents."
|
||||
{
|
||||
"title": "promptAuthority",
|
||||
"type": "string"
|
||||
},
|
||||
"nativeAuthorities": {
|
||||
{
|
||||
"title": "nativeAuthorities",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"quarantinedSurfaces": {
|
||||
{
|
||||
"title": "quarantinedSurfaces",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schemaVersion",
|
||||
"runtimeId",
|
||||
"verseId",
|
||||
"surfaceId",
|
||||
"status",
|
||||
"generatedAtUtc",
|
||||
"summary",
|
||||
"codexBridgeRole",
|
||||
"epiphanyAuthorityRole",
|
||||
"promptAuthority"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,17 @@
|
|||
"title": "Epiphany CultMesh Operator Status",
|
||||
"path": "epiphany.cultmesh.operator-status.schema.json"
|
||||
},
|
||||
{
|
||||
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.cultmesh.operator-snapshot.schema.json",
|
||||
"kind": "document_payload",
|
||||
"wireContracts": [
|
||||
"cultnet.schema.v0"
|
||||
],
|
||||
"schemaVersion": "epiphany.cultmesh.operator_snapshot.v0",
|
||||
"documentType": "epiphany.cultmesh.operator_snapshot",
|
||||
"title": "Epiphany CultMesh Operator Snapshot",
|
||||
"path": "epiphany.cultmesh.operator-snapshot.schema.json"
|
||||
},
|
||||
{
|
||||
"schemaId": "https://gamecult.dev/epiphany/cultnet/epiphany.surface.scene.schema.json",
|
||||
"kind": "document_payload",
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -107,7 +107,7 @@ active_subgoals:
|
|||
|
||||
accepted_design:
|
||||
- Distributed Epiphany dreaming is a CultMesh typed-document problem, not prompt folklore. CultCache owns local typed documents, Epiphany owns export/import/adoption policy, CultNet owns wire/provenance/shard delivery, and CultMesh owns Verses, peer exchange, leases, shard logs, replicas, and watchable runtime surfaces. Start with local dream document types and a local store before public Verse wiring.
|
||||
- The first Rust CultMesh integration slice is landed and repaired to compile from repo-contained vendored crates. `vendor/cultmesh-rs` is a small Rust node/database facade over vendored CultCache and CultNet with document-set registration and durable typed put/get/delete. `vendor/cultcache-rs` now reads and writes the `cultcache.store.v1` snapshot format used by `state/ledgers.msgpack`, so `epiphany-state status` is a working re-entry rite again. `epiphany-core` depends on `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`, exposes an `EpiphanyCultMeshStatusEntry`, records typed `EpiphanyCultMeshVersePolicyEntry` documents for the internal/local-area/global Verse tiers, and records typed `EpiphanyCultMeshGlobalRoomPolicyEntry` documents for threaded public global rooms such as dreams, architecture, research, faces, GameCult, and governance. Native operator status is now a typed `EpiphanyCultMeshOperatorStatusEntry` in the internal Verse; it names Codex as bridge transport, Epiphany as authority owner, prompt-authority separation, and the quarantined Rider/Unity optional surfaces.
|
||||
- The first Rust CultMesh integration slice is landed and repaired to compile from repo-contained vendored crates. `vendor/cultmesh-rs` is a small Rust node/database facade over vendored CultCache and CultNet with document-set registration and durable typed put/get/delete. `vendor/cultcache-rs` now reads and writes the `cultcache.store.v1` snapshot format used by `state/ledgers.msgpack`, so `epiphany-state status` is a working re-entry rite again. `epiphany-core` depends on `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`, exposes an `EpiphanyCultMeshStatusEntry`, records typed `EpiphanyCultMeshVersePolicyEntry` documents for the internal/local-area/global Verse tiers, and records typed `EpiphanyCultMeshGlobalRoomPolicyEntry` documents for threaded public global rooms such as dreams, architecture, research, faces, GameCult, and governance. Native operator status is now a typed `EpiphanyCultMeshOperatorStatusEntry` in the internal Verse; it names Codex as bridge transport, Epiphany as authority owner, prompt-authority separation, and the quarantined Rider/Unity optional surfaces. Native operator snapshots are typed `EpiphanyCultMeshOperatorSnapshotEntry` documents distilled from operator-safe status artifacts; local status runs now write `.epiphany-run/cultmesh/operator-snapshots.ccmp` instead of leaving JSON artifacts as the only operator memory.
|
||||
- Mind's CultNet contract surface is native enough for the next Aquarium/CultMesh cut: `epiphany-core::mind_gateway` defines thought, state-effect proposal, gateway-review, commit-receipt, rejection-receipt, and Verse-adoption document contracts; runtime-spine advertises those mutation/read contracts; CultMesh persists matching `EpiphanyCultMeshMindContractEntry` policy documents so the private state guardian boundary is inspectable as typed state.
|
||||
- Body's repo-access contract surface is now named beside Mind's state gate: `epiphany-core::body_gateway` defines repo access requests, access reviews, grant/refusal receipts, snapshot receipts, and mutation receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshBodyContractEntry` policy documents so repo substrate access has its own typed guardian instead of hiding behind worker launch scope.
|
||||
- Eyes' evidence contract surface is named beside Body and Mind: `epiphany-core::eyes_gateway` defines evidence requests, evidence reviews, source lookup receipts, evidence packets, and evidence refusal receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshEyesContractEntry` policy documents so retrieved snippets and source reads are not confused with inspected evidence.
|
||||
|
|
@ -481,4 +481,11 @@ current_status:
|
|||
read, and smoke `epiphany.cultmesh.operator_status.v0`; runtime-spine
|
||||
advertises it as the read-only operator status contract, and the active
|
||||
schema catalog no longer advertises Rider/Unity bridge surfaces.
|
||||
next_action: Continue Codex starvation and CultNet liberation by wiring the next operator/runtime fact through native CultMesh/CultNet documents. The strongest next target is a CultNet-first operator snapshot/intent/receipt surface around the local runner or MVP status view, keeping Codex app-server JSON-RPC as compatibility projection only.
|
||||
The next operator snapshot cut is landed: `epiphany-operator-snapshot`
|
||||
distills the operator-safe MVP status artifact into
|
||||
`epiphany.cultmesh.operator_snapshot.v0`, runtime-spine advertises that
|
||||
document as local-user writable, and `tools/epiphany_local_run.ps1 -Mode
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -74,9 +74,11 @@ 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"
|
||||
$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"
|
||||
$operatorSnapshotStore = Join-Path $Root ".epiphany-run\cultmesh\operator-snapshots.ccmp"
|
||||
|
||||
if (-not $SkipBuild) {
|
||||
Invoke-Checked `
|
||||
|
|
@ -94,6 +96,7 @@ if (-not $SkipBuild) {
|
|||
"build",
|
||||
"--manifest-path", ".\epiphany-core\Cargo.toml",
|
||||
"--bin", "epiphany-mvp-status",
|
||||
"--bin", "epiphany-operator-snapshot",
|
||||
"--bin", "epiphany-mvp-coordinator",
|
||||
"--bin", "epiphany-mvp-coordinator-smoke",
|
||||
"--bin", "epiphany-heartbeat-store",
|
||||
|
|
@ -115,7 +118,7 @@ if (-not $SkipBuild) {
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($required in @($codexAppServer, $statusExe, $coordinatorExe)) {
|
||||
foreach ($required in @($codexAppServer, $statusExe, $operatorSnapshotExe, $coordinatorExe)) {
|
||||
if (-not (Test-Path -LiteralPath $required)) {
|
||||
throw "required binary not found: $required"
|
||||
}
|
||||
|
|
@ -151,6 +154,20 @@ if ($Mode -eq "status") {
|
|||
-WorkingDirectory $Root `
|
||||
-StdoutPath (Join-Path $artifactRoot "status.stdout.json") `
|
||||
-StderrPath (Join-Path $artifactRoot "status.stderr.log")
|
||||
Invoke-Checked `
|
||||
-Label "write CultMesh operator snapshot" `
|
||||
-FilePath $operatorSnapshotExe `
|
||||
-Arguments @(
|
||||
"from-status",
|
||||
"--store", $operatorSnapshotStore,
|
||||
"--runtime-id", "epiphany-local",
|
||||
"--snapshot-id", "$runId-status",
|
||||
"--source-mode", "status",
|
||||
"--input", $statusJson
|
||||
) `
|
||||
-WorkingDirectory $Root `
|
||||
-StdoutPath (Join-Path $artifactRoot "operator-snapshot.stdout.json") `
|
||||
-StderrPath (Join-Path $artifactRoot "operator-snapshot.stderr.log")
|
||||
}
|
||||
|
||||
if ($Mode -eq "plan") {
|
||||
|
|
@ -239,12 +256,15 @@ $summary = @"
|
|||
- dogfoodRoot: $dogfoodRoot
|
||||
- codexAppServer: $codexAppServer
|
||||
- statusBinary: $statusExe
|
||||
- operatorSnapshotBinary: $operatorSnapshotExe
|
||||
- operatorSnapshotStore: $operatorSnapshotStore
|
||||
- coordinatorBinary: $coordinatorExe
|
||||
- openaiRuntimeBinary: $openaiRuntimeExe
|
||||
|
||||
This is an operator entrypoint over the current compatibility shell. Codex
|
||||
app-server remains the JSON-RPC edge for now; Epiphany state, heartbeat, role
|
||||
memory, runtime-spine, and artifacts remain typed native surfaces behind it.
|
||||
memory, runtime-spine, operator snapshots, and artifacts remain typed native
|
||||
surfaces behind it.
|
||||
"@
|
||||
Set-Content -LiteralPath (Join-Path $artifactRoot "README.md") -Value $summary -Encoding UTF8
|
||||
|
||||
|
|
|
|||
12
vendor/codex/codex-rs/Cargo.lock
generated
vendored
12
vendor/codex/codex-rs/Cargo.lock
generated
vendored
|
|
@ -4230,6 +4230,7 @@ dependencies = [
|
|||
"rmp-serde",
|
||||
"serde",
|
||||
"serde_bytes",
|
||||
"serde_json",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
|
|
@ -4242,6 +4243,16 @@ dependencies = [
|
|||
"syn 2.0.114",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cultmesh-rs"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cultcache-rs",
|
||||
"cultnet-rs",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cultnet-rs"
|
||||
version = "0.1.0"
|
||||
|
|
@ -5104,6 +5115,7 @@ dependencies = [
|
|||
"bm25",
|
||||
"chrono",
|
||||
"cultcache-rs",
|
||||
"cultmesh-rs",
|
||||
"cultnet-rs",
|
||||
"epiphany-openai-adapter",
|
||||
"epiphany-state-model",
|
||||
|
|
|
|||
Reference in a new issue